Owneat Technical Guide main Help

Class UserLoginCommandHandler

Namespace: Identity.Application.Requests.Handlers.User
Assembly: Identity.Application.dll

public sealed class UserLoginCommandHandler : IRequestHandler<UserLoginCommand, Result<TokenResponse>>

Inheritance

object ← UserLoginCommandHandler

Implements

IRequestHandler<UserLoginCommand, Result<TokenResponse\>\>

Inherited Members

object.Equals\(object?\), object.Equals\(object?, object?\), object.GetHashCode\(\), object.GetType\(\), object.ReferenceEquals\(object?, object?\), object.ToString\(\)

Constructors

UserLoginCommandHandler\(IUserRepository, IPasswordHasher<User\>, IJwtHelper\)

Handler that check credentials sent by the client and return a Identity.Application.Responses.Jwt.TokenResponse to make the Identity.Application.Requests.Handlers.User logged in.

public UserLoginCommandHandler(IUserRepository userRepository, IPasswordHasher<User> passwordHasher, IJwtHelper jwtHelper)

Parameters

userRepository IUserRepository

Repository of Identity.Application.Requests.Handlers.User.

passwordHasher IPasswordHasher < User \>

Microsoft.AspNetCore.Identity.IPasswordHasher%601 is a class that hashes password with encryption and check if they match with a given entry.

jwtHelper IJwtHelper

JWT Helper that defines methods to help manipulate and create JWT.

Methods

Handle\(UserLoginCommand, CancellationToken\)

Handles a request

public Task<Result<TokenResponse>> Handle(UserLoginCommand request, CancellationToken cancellationToken)

Parameters

request UserLoginCommand

The request

cancellationToken CancellationToken

Cancellation token

Returns

Task <Result< TokenResponse \>\>

Response from the request

Last modified: 21 May 2024