AuthSessionRecord class
Persisted server-side session metadata.
tokenHash is the digest of the opaque session token held by the client; the raw token must never be persisted. This record is deliberately separate from AuthSession, which is the public response projection.
Constructors
- AuthSessionRecord({required String id, required String tokenHash, required String userId, required DateTime createdAt, required DateTime expiresAt, required DateTime lastUsedAt, required String authenticationMethod, DateTime? revokedAt, String? ipAddress, String? userAgent, String? impersonatedBy})
- Creates persisted metadata for a server-side session.
Properties
- authenticationMethod → String
-
Authentication mechanism that issued the session.
final
- createdAt → DateTime
-
Time at which the session was issued.
final
- expiresAt → DateTime
-
Time after which the session cannot authenticate.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Stable persistence identifier for this session record.
final
- impersonatedBy → String?
-
Original administrator for an impersonated server session.
final
- ipAddress → String?
-
Direct connection address observed when the session was issued.
final
- lastUsedAt → DateTime
-
Most recent authenticated use of the session.
final
- revokedAt → DateTime?
-
Time at which the session was revoked, if any.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tokenHash → String
-
Digest of the client-held session token.
final
- userAgent → String?
-
User-agent value observed when the session was issued.
final
- userId → String
-
User owning the session.
final
Methods
-
copyWith(
{DateTime? lastUsedAt, DateTime? revokedAt}) → AuthSessionRecord - Creates a changed copy while preserving immutable session metadata.
-
isActive(
{DateTime? now}) → bool -
Whether this record is valid at
now. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toStorageJson(
) → Map< String, dynamic> - Serializes persistence-safe session metadata.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited