FactorOtp

@accounts/factor-otpGlobalsFactorOtp

Hierarchy

  • FactorOtp

Implements

  • AuthenticatorService

Index

Constructors

Properties

Methods

Constructors

constructor

+ new FactorOtp(options: FactorOtpOptions): FactorOtp

Defined in factor-otp/src/index.ts:30

Parameters:

NameTypeDefault
optionsFactorOtpOptions{}

Returns: FactorOtp

Properties

authenticatorName

authenticatorName: string = "otp"

Defined in factor-otp/src/index.ts:26


server

server: AccountsServer

Defined in factor-otp/src/index.ts:27

Methods

associate

associate(userIdOrMfaChallenge: string | MfaChallenge): Promise‹object›

Defined in factor-otp/src/index.ts:44

description Start the association of a new OTP device

Parameters:

NameType
userIdOrMfaChallengestring | MfaChallenge

Returns: Promise‹object›


authenticate

authenticate(mfaChallenge: MfaChallenge, authenticator: DbAuthenticatorOtp, __namedParameters: object): Promise‹boolean›

Defined in factor-otp/src/index.ts:102

description Verify that the code provided by the user is valid

Parameters:

mfaChallenge: MfaChallenge

authenticator: DbAuthenticatorOtp

__namedParameters: object

NameType
codestring

Returns: Promise‹boolean›


sanitize

sanitize(authenticator: DbAuthenticatorOtp): Authenticator

Defined in factor-otp/src/index.ts:118

description Remove the sensitive fields from the database authenticator. The object returned by this function can be exposed to the user safely.

Parameters:

NameType
authenticatorDbAuthenticatorOtp

Returns: Authenticator


setStore

setStore(store: DatabaseInterface): void

Defined in factor-otp/src/index.ts:37

Parameters:

NameType
storeDatabaseInterface

Returns: void