Skip to main content

Abstract Class: BaseAuthOTPRouteMongo

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

Extends

Constructors

Constructor

new BaseAuthOTPRouteMongo(): BaseAuthOTPRouteMongo

Returns

BaseAuthOTPRouteMongo

Inherited from

BaseAuthOTPRoute.constructor

Properties

aliasClass

protected aliasClass: any = AliasMongo

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

Overrides

BaseAuthOTPRoute.aliasClass


aliasRepo?

protected optional aliasRepo?: RepoUtils<AliasMongo>

Defined in: src/routes/BaseAuthOTPRoute.ts:26

Inherited from

BaseAuthOTPRoute.aliasRepo


authMiddleware?

protected optional authMiddleware?: AuthMiddleware

Defined in: src/routes/BaseAuthOTPRoute.ts:29

Inherited from

BaseAuthOTPRoute.authMiddleware


jwtConfig?

protected optional jwtConfig?: any

Defined in: src/routes/BaseAuthOTPRoute.ts:32

Inherited from

BaseAuthOTPRoute.jwtConfig


messagingUtils?

protected optional messagingUtils?: MessagingUtils

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

Inherited from

BaseAuthOTPRoute.messagingUtils


objectFactory?

protected optional objectFactory?: ObjectFactory

Defined in: src/routes/BaseAuthOTPRoute.ts:35

Inherited from

BaseAuthOTPRoute.objectFactory


secretClass

protected secretClass: any = SecretMongo

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

Overrides

BaseAuthOTPRoute.secretClass


secretRepo?

protected optional secretRepo?: RepoUtils<SecretMongo>

Defined in: src/routes/BaseAuthOTPRoute.ts:40

Inherited from

BaseAuthOTPRoute.secretRepo


template

protected template: string = "login-otp"

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

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

Inherited from

BaseAuthOTPRoute.template


userClass

protected userClass: any = UserMongo

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

Overrides

BaseAuthOTPRoute.userClass


userRepo?

protected optional userRepo?: RepoUtils<UserMongo>

Defined in: src/routes/BaseAuthOTPRoute.ts:45

Inherited from

BaseAuthOTPRoute.userRepo


userUtils?

protected optional userUtils?: UserUtils<UserMongo, AliasMongo>

Defined in: src/routes/BaseAuthOTPRoute.ts:47

Inherited from

BaseAuthOTPRoute.userUtils

Methods

authenticate()

authenticate(user): Promise<AuthResult | undefined>

Defined in: src/routes/BaseAuthOTPRoute.ts:112

Authenticates the user using OTP and returns a JSON Web Token access token to be used with future API requests.

Parameters

user

JWTUser

Returns

Promise<AuthResult | undefined>

Inherited from

BaseAuthOTPRoute.authenticate


convertAliasType()

protected convertAliasType(type): OTPContactType

Defined in: src/routes/BaseAuthOTPRoute.ts:120

Parameters

type

AliasType

Returns

OTPContactType

Inherited from

BaseAuthOTPRoute.convertAliasType


getContact()

protected getContact(id): Promise<OTPContact | undefined>

Defined in: src/routes/BaseAuthOTPRoute.ts:136

Retrieves the alias with the given unique id.

Parameters

id

string

The unique id of the alias to retrieve.

Returns

Promise<OTPContact | undefined>

The alias if found, otherwise undefined.

Inherited from

BaseAuthOTPRoute.getContact


getContacts()

protected getContacts(id): Promise<OTPContact[]>

Defined in: src/routes/BaseAuthOTPRoute.ts:156

Retrieves all aliases for the user with the given id.

Parameters

id

string

The unique id of the user to lookup.

Returns

Promise<OTPContact[]>

Inherited from

BaseAuthOTPRoute.getContacts


getUser()

protected getUser(uid): Promise<JWTUser | undefined>

Defined in: src/routes/BaseAuthOTPRoute.ts:196

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

BaseAuthOTPRoute.getUser


initialize()

protected initialize(): Promise<void>

Defined in: src/routes/BaseAuthOTPRoute.ts:53

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

Returns

Promise<void>

Inherited from

BaseAuthOTPRoute.initialize


notifyContact()

protected notifyContact(contact, totp): Promise<void>

Defined in: src/routes/BaseAuthOTPRoute.ts:203

Parameters

contact

OTPContact

totp

string

Returns

Promise<void>

Inherited from

BaseAuthOTPRoute.notifyContact