Class: MFARequiredError
Defined in: src/auth/errors.ts:121
MFA required error.
Remarks
Thrown when MFA is required but not provided. HTTP mapping: 401 Unauthorized with MFA challenge
Extends
Constructors
new MFARequiredError()
new MFARequiredError(
challengeId,methods,expiresAt):MFARequiredError
Defined in: src/auth/errors.ts:146
Creates a new MFARequiredError.
Parameters
challengeId
string
Challenge identifier
methods
readonly string[]
Available MFA methods
expiresAt
Date
Challenge expiration
Returns
Overrides
Properties
cause?
readonlyoptionalcause:Error
Defined in: src/types/errors.ts:71
Original error that caused this error (if any).
Remarks
Error chaining allows tracking the full error context through multiple layers of the application. Useful for debugging complex error scenarios.
Example
try {
await fetchData();
} catch (err) {
throw new ValidationError('Failed to validate data', 'field', 'required', err as Error);
}
Inherited from
challengeId
readonlychallengeId:string
Defined in: src/auth/errors.ts:127
Challenge ID for MFA completion.
code
readonlycode:"MFA_REQUIRED"='MFA_REQUIRED'
Defined in: src/auth/errors.ts:122
Machine-readable error code.
Remarks
Error codes are unique identifiers for error types, enabling programmatic error handling (switch statements, error maps), error tracking in monitoring systems, and client-side error translation (i18n).
Overrides
expiresAt
readonlyexpiresAt:Date
Defined in: src/auth/errors.ts:137
Challenge expiration timestamp.
methods
readonlymethods: readonlystring[]
Defined in: src/auth/errors.ts:132
Available MFA methods.