Abstract Class: BaseAuthOTPRouteMongo
Defined in: auth/src/routes/mongo/BaseAuthOTPRouteMongo.ts:8
Extends
Constructors
Constructor
new BaseAuthOTPRouteMongo():
BaseAuthOTPRouteMongo
Returns
BaseAuthOTPRouteMongo
Inherited from
Properties
aliasClass
protectedaliasClass:any=AliasMongo
Defined in: auth/src/routes/mongo/BaseAuthOTPRouteMongo.ts:9
Overrides
aliasRepo?
protectedoptionalaliasRepo?:RepoUtils<AliasMongo>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:41
Inherited from
authMiddleware?
protectedoptionalauthMiddleware?:AuthMiddleware
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:44
Inherited from
BaseAuthOTPRoute.authMiddleware
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:50
Inherited from
BaseAuthOTPRoute.defaultScopes
jwtConfig?
protectedoptionaljwtConfig?:any
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:53
Inherited from
logger
protectedlogger:any
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:47
Inherited from
messagingUtils?
protectedoptionalmessagingUtils?:MessagingUtils
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:56
Inherited from
BaseAuthOTPRoute.messagingUtils
rateLimiter?
protectedoptionalrateLimiter?:RateLimiter
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:59
Inherited from
secretClass
protectedsecretClass:any=SecretMongo
Defined in: auth/src/routes/mongo/BaseAuthOTPRouteMongo.ts:10
Overrides
secretRepo?
protectedoptionalsecretRepo?:RepoUtils<SecretMongo>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:61
Inherited from
template
protectedtemplate:string="login-otp"
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:64
The name of the messaging template to use for sending notifications.
Inherited from
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:67
Inherited from
userClass
protecteduserClass:any=UserMongo
Defined in: auth/src/routes/mongo/BaseAuthOTPRouteMongo.ts:11
Overrides
userRepo?
protectedoptionaluserRepo?:RepoUtils<UserMongo>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:69
Inherited from
userUtils?
protectedoptionaluserUtils?:UserUtils<UserMongo,AliasMongo>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:71
Inherited from
Methods
authenticate()
authenticate(
user,req,res):Promise<AuthResult|undefined>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:138
Authenticates the user using OTP and returns a JSON Web Token access token to be used with future API requests.
Parameters
user
JWTUser
req
HttpRequest
res
HttpResponse
Returns
Promise<AuthResult | undefined>
Inherited from
convertAliasType()
protectedconvertAliasType(type):OTPContactType
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:146
Parameters
type
Returns
Inherited from
BaseAuthOTPRoute.convertAliasType
getContact()
protectedgetContact(id,channel?):Promise<OTPContact|undefined>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:166
Retrieves the alias with the given unique id.
Parameters
id
string
The unique id of the alias to retrieve.
channel?
string
The delivery channel the client asked for, if any. Only "whatsapp" is meaningful - it
selects WhatsApp delivery, and is honored only for a verified phone alias while WhatsApp is configured
(see isWhatsAppConfigured()), otherwise undefined is returned so nothing is sent. Any other value
(or none) leaves the alias on its default channel (e-mail or SMS), exactly as before.
Returns
Promise<OTPContact | undefined>
The alias if found, otherwise undefined.
Inherited from
getContacts()
protectedgetContacts(id):Promise<OTPContact[]>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:202
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
getUser()
protectedgetUser(uid):Promise<JWTUser|undefined>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:255
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
initialize()
protectedinitialize():Promise<void>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:77
Called on server startup to initialize the route with any defaults.
Returns
Promise<void>
Inherited from
notifyContact()
protectednotifyContact(contact,totp):Promise<void>
Defined in: auth/src/routes/BaseAuthOTPRoute.ts:262
Parameters
contact
totp
string
Returns
Promise<void>