AuthTwoFactorRecord class

Persisted two-factor state for one user.

protectedSecret is opaque to the persistence adapter and must contain the output of the configured AuthTwoFactorSecretProtector. Recovery codes are stored as digests and are removed atomically when consumed.

Constructors

AuthTwoFactorRecord({required String userId, required String protectedSecret, required DateTime enrollmentExpiresAt, bool verified = false, List<String> recoveryCodeHashes = const <String>[], int failedVerificationCount = 0, DateTime? lockedUntil, DateTime? updatedAt})
Creates persisted state for a user's two-factor enrollment.

Properties

enrollmentExpiresAt DateTime
Expiry for an unverified enrollment.
final
failedVerificationCount int
Consecutive failed TOTP attempts.
final
hashCode int
The hash code for this object.
no setterinherited
lockedUntil DateTime?
Temporary lockout expiry after repeated invalid codes.
final
protectedSecret String
Protected TOTP secret, never a raw secret in durable storage.
final
recoveryCodeHashes List<String>
Digests of unused recovery codes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
updatedAt DateTime?
Last persistence update time.
final
userId String
User owning this factor.
final
verified bool
Whether the enrollment has been verified and activated.
final

Methods

copyWith({String? protectedSecret, DateTime? enrollmentExpiresAt, bool? verified, List<String>? recoveryCodeHashes, int? failedVerificationCount, DateTime? lockedUntil, bool clearLockedUntil = false, DateTime? updatedAt}) AuthTwoFactorRecord
Creates a changed persistence record.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited