Abstract Class: BaseAuthTOTPRoute<U, A, S>
Defined in: src/routes/BaseAuthTOTPRoute.ts:21
Extended by
Type Parameters
U
U extends User
A
A extends Alias
S
S extends Secret
Constructors
Constructor
new BaseAuthTOTPRoute<
U,A,S>():BaseAuthTOTPRoute<U,A,S>
Returns
BaseAuthTOTPRoute<U, A, S>
Properties
aliasClass
abstractprotectedaliasClass:any
Defined in: src/routes/BaseAuthTOTPRoute.ts:22
authMiddleware?
protectedoptionalauthMiddleware?:AuthMiddleware
Defined in: src/routes/BaseAuthTOTPRoute.ts:27
jwtConfig?
protectedoptionaljwtConfig?:any
Defined in: src/routes/BaseAuthTOTPRoute.ts:30
messagingUtils?
protectedoptionalmessagingUtils?:MessagingUtils
Defined in: src/routes/BaseAuthTOTPRoute.ts:36
objectFactory?
protectedoptionalobjectFactory?:ObjectFactory
Defined in: src/routes/BaseAuthTOTPRoute.ts:33
secretClass
abstractprotectedsecretClass:any
Defined in: src/routes/BaseAuthTOTPRoute.ts:23
secretRepo?
protectedoptionalsecretRepo?:RepoUtils<S>
Defined in: src/routes/BaseAuthTOTPRoute.ts:38
template
protectedtemplate:string="login-otp"
Defined in: src/routes/BaseAuthTOTPRoute.ts:41
The name of the messaging template to use for sending notifications.
userClass
abstractprotecteduserClass:any
Defined in: src/routes/BaseAuthTOTPRoute.ts:24
userUtils?
protectedoptionaluserUtils?:UserUtils<U,A>
Defined in: src/routes/BaseAuthTOTPRoute.ts:43
Methods
authenticate()
authenticate(
user):Promise<AuthResult|undefined>
Defined in: src/routes/BaseAuthTOTPRoute.ts:92
Authenticates the user using TOTP and returns a JSON Web Token access token to be used with future API requests.
Parameters
user
JWTUser
Returns
Promise<AuthResult | undefined>
getSecrets()
protectedgetSecrets(uid):Promise<TOTPSecret[]>
Defined in: src/routes/BaseAuthTOTPRoute.ts:100
Parameters
uid
string
Returns
Promise<TOTPSecret[]>
getUser()
protectedgetUser(uid):Promise<JWTUser|undefined>
Defined in: src/routes/BaseAuthTOTPRoute.ts:123
Retrieves the user with the given unique id.
Parameters
uid
string
The unique id of the user to retrieve.
Returns
Promise<JWTUser | undefined>
The user if found, otherwise undefined.
initialize()
protectedinitialize():Promise<void>
Defined in: src/routes/BaseAuthTOTPRoute.ts:49
Called on server startup to initialize the route with any defaults.
Returns
Promise<void>