Skip to main content

Abstract Class: BaseAuthTOTPRouteMongo

Defined in: src/routes/mongo/BaseAuthTOTPRouteMongo.ts:7

Extends

Constructors

Constructor

new BaseAuthTOTPRouteMongo(): BaseAuthTOTPRouteMongo

Returns

BaseAuthTOTPRouteMongo

Inherited from

BaseAuthTOTPRoute.constructor

Properties

aliasClass

protected aliasClass: any = AliasMongo

Defined in: src/routes/mongo/BaseAuthTOTPRouteMongo.ts:8

Overrides

BaseAuthTOTPRoute.aliasClass


authMiddleware?

protected optional authMiddleware?: AuthMiddleware

Defined in: src/routes/BaseAuthTOTPRoute.ts:27

Inherited from

BaseAuthTOTPRoute.authMiddleware


jwtConfig?

protected optional jwtConfig?: any

Defined in: src/routes/BaseAuthTOTPRoute.ts:30

Inherited from

BaseAuthTOTPRoute.jwtConfig


messagingUtils?

protected optional messagingUtils?: MessagingUtils

Defined in: src/routes/BaseAuthTOTPRoute.ts:36

Inherited from

BaseAuthTOTPRoute.messagingUtils


objectFactory?

protected optional objectFactory?: ObjectFactory

Defined in: src/routes/BaseAuthTOTPRoute.ts:33

Inherited from

BaseAuthTOTPRoute.objectFactory


secretClass

protected secretClass: any = SecretMongo

Defined in: src/routes/mongo/BaseAuthTOTPRouteMongo.ts:9

Overrides

BaseAuthTOTPRoute.secretClass


secretRepo?

protected optional secretRepo?: RepoUtils<SecretMongo>

Defined in: src/routes/BaseAuthTOTPRoute.ts:38

Inherited from

BaseAuthTOTPRoute.secretRepo


template

protected template: string = "login-otp"

Defined in: src/routes/BaseAuthTOTPRoute.ts:41

The name of the messaging template to use for sending notifications.

Inherited from

BaseAuthTOTPRoute.template


userClass

protected userClass: any = UserMongo

Defined in: src/routes/mongo/BaseAuthTOTPRouteMongo.ts:10

Overrides

BaseAuthTOTPRoute.userClass


userUtils?

protected optional userUtils?: UserUtils<UserMongo, AliasMongo>

Defined in: src/routes/BaseAuthTOTPRoute.ts:43

Inherited from

BaseAuthTOTPRoute.userUtils

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>

Inherited from

BaseAuthTOTPRoute.authenticate


getSecrets()

protected getSecrets(uid): Promise<TOTPSecret[]>

Defined in: src/routes/BaseAuthTOTPRoute.ts:100

Parameters

uid

string

Returns

Promise<TOTPSecret[]>

Inherited from

BaseAuthTOTPRoute.getSecrets


getUser()

protected getUser(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.

Inherited from

BaseAuthTOTPRoute.getUser


initialize()

protected initialize(): Promise<void>

Defined in: src/routes/BaseAuthTOTPRoute.ts:49

Called on server startup to initialize the route with any defaults.

Returns

Promise<void>

Inherited from

BaseAuthTOTPRoute.initialize