InMemoryAuthTwoFactorStore class final
In-memory two-factor store for tests and local examples.
- Implemented types
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
captureDeletionState(
) → Object -
Captures deletion state.
override
-
clearVerificationFailures(
String userId, {required DateTime now}) → AuthTwoFactorRecord? -
Atomically clears failed verification state after a successful code.
override
-
consumeRecoveryCode(
String userId, String codeHash, {required DateTime now}) → bool -
Consumes one matching recovery-code digest atomically and clears a
temporary verification lockout.
override
-
delete(
String userId) → void -
Deletes the factor record belonging to
userId.override -
deleteUserDataForDeletion(
String userId) → void -
Deletes user data for deletion.
override
-
findByUserId(
String userId) → AuthTwoFactorRecord? -
Looks up the factor record belonging to
userId.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordFailedVerification(
String userId, {required DateTime now, required int maxAttempts, required Duration lockoutDuration}) → AuthTwoFactorRecord? -
Atomically records a failed verification and applies lockout policy.
override
-
restoreDeletionState(
Object checkpoint) → void -
Restores deletion state.
override
-
save(
AuthTwoFactorRecord record) → AuthTwoFactorRecord -
Creates or replaces the factor record for
record.override -
saveIfCurrent(
AuthTwoFactorRecord expected, AuthTwoFactorRecord replacement) → bool -
Replaces
expectedwithreplacementonly when the stored record is unchanged. Durable implementations must perform this comparison and write atomically, for example with a conditional update in a transaction.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited