Persistence contract for server-side sessions.
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
-
create(
AuthSessionRecord session) → FutureOr< AuthSessionRecord> - Persists a newly issued session record with valid identity and lifetime fields.
-
find(
String tokenHash) → FutureOr< AuthSessionRecord?> - Finds a session by the digest of its client-held token.
-
listForUser(
String userId) → FutureOr< List< AuthSessionRecord> > -
Lists persisted sessions belonging to
userId. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
revoke(
String tokenHash, {DateTime? revokedAt}) → FutureOr< AuthSessionRecord?> - Atomically marks a session as revoked.
-
revokeAllForUser(
String userId, {DateTime? revokedAt}) → FutureOr< int> -
Atomically revokes every session belonging to
userId. -
revokeAllForUserExcept(
String userId, String currentSessionId, {DateTime? revokedAt}) → FutureOr< int> -
Atomically revokes every session except
currentSessionId. -
revokeById(
String userId, String sessionId, {DateTime? revokedAt}) → FutureOr< AuthSessionRecord?> -
Atomically revokes a session by its public persistence ID when it belongs
to
userId. -
rotate(
{required String previousTokenHash, required AuthSessionRecord replacement}) → FutureOr< AuthSessionRecord?> -
Atomically revokes
previousTokenHashand createsreplacement. -
toString(
) → String -
A string representation of this object.
inherited
-
touch(
String tokenHash, DateTime lastUsedAt) → FutureOr< AuthSessionRecord?> - Atomically advances last-used time for an active session.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited