UNPKG

lets-mfa

Version:

Free, secure, and quick way to add MFA to your existing app. No user migrations or re-architecture needed!

43 lines 1.87 kB
export interface AuthenticationOptions { enrollRequired: boolean; } export interface SMSProviderOptions { twilio?: { accountSid: string; authToken: string; from: string; }; } export interface SMSMethodOptions extends AuthenticationOptions { /** The SMSPRovider options for the request */ provider: SMSProviderOptions; /** The maximum number of attempts allowed before failure. Will be replaced with a lower number if too high. */ max_attempts: number; /** If provided, the user must complete the enroll step step with this phone number */ enrollPhoneNumber?: string; } export interface TestMethodOptions extends AuthenticationOptions { /** The test code to use for the request */ code: string; /** The maximum number of attempts allowed before failure. Will be replaced with a lower number if too high. */ max_attempts: number; } export interface OTPMethodOptions extends AuthenticationOptions { /** The maximum number of attempts allowed before failure. Will be replaced with a lower number if too high. */ max_attempts: number; } export interface WebauthnMethodOptions extends AuthenticationOptions { /** The maximum number of attempts allowed before failure. Will be replaced with a lower number if too high. */ max_attempts: number; /** The type of WebAuthen attestation type to request. 'none' means do not request attestations. 'direct' means any supported format is accepted */ attestation_type: "none" | "direct"; /** Whether the user should be required to verify the response */ user_verification: "discouraged" | "preferred" | "required"; } export interface AuthenticationMethods { sms?: SMSMethodOptions; test?: TestMethodOptions; otp?: OTPMethodOptions; webauthn?: WebauthnMethodOptions; } //# sourceMappingURL=auth-methods.d.ts.map