injected API service use to handle the user related operations
injected service use to handle the two factor auth related operations
injected service use to handle the refresh token related operations
configuration for login handler
injected logger used to handle the logging
request context [headers, body, params, query].
200 Status Ok
{
accessToken: string;
refreshToken?: string;
userId: string;
}
This handler will create login by applying the following steps in sequence:
Check user password (userService.checkUserPassword)
Generate 2FA code if 2FA is enabled (twoFactorAuthService.generateCode)
Send 2FA code to user email if 2FA is enabled (twoFactorAuthService.sendMail)
Generate access token (crypto.generateUserAccessToken)
Generate refresh token if refresh token is enabled (enableRefreshToken)
Set access token and refresh token to cookie if auth type is cookie (setTokenToCookie)
Return the response
401 NBError Unauthorized
500 NBError Internal Server Error
Generated using TypeDoc
Create login handler