Class MfaEnrollmentError

Error thrown when enrolling an MFA authenticator fails.

Example

try {
const enrollment = await mfa.enroll({
authenticator_types: ['otp']
});
} catch (error) {
if (error instanceof MfaEnrollmentError) {
console.log(error.error); // 'invalid_phone_number'
console.log(error.error_description); // 'Invalid phone number format'
}
}

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

data?: Record<string, any>

Any other fields from the server's error response (for example auth_session).

error: string

The error code from the server response.

error_description: string

The error_description from the server response.

Methods