TwoFactor <CustomUser>
Index
Constructors
Methods
Constructors
constructor
Type parameters
- CustomUser: User = User
Parameters
options: AccountsTwoFactorOptions = {}
Returns TwoFactor<CustomUser>
Methods
publicauthenticate
Parameters
user: User
code: string
Returns Promise<void>
publicgetNewAuthSecret
Generate a new two factor secret
Returns GeneratedSecret
publicset
Verify the code is correct Add the code to the user profile Throw if user already have 2fa enabled
Parameters
userId: string
secret: GeneratedSecret
code: string
Returns Promise<void>
publicsetUserStore
Set two factor store
Parameters
store: DatabaseInterfaceUser<CustomUser>
Returns void
publicunset
Remove two factor for a user
Parameters
userId: string
code: string
Returns Promise<void>
Authenticate a user with a 2fa code