AuthSessions class abstract final

Management functions for AuthSessions.

This should be used instead of AuthSession.db.

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

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

Static Properties

admin AuthSessionsAdmin
Admin-related functions for managing session.
final
config AuthSessionConfig
The current session module configuration.
getter/setter pair
secretsTestOverride ↔ AuthSessionSecrets?
Secrets to the used for testing. Also affects the internally used AuthSessionKeyHash.
getter/setter pair

Static Methods

authenticationHandler(Session session, String key) Future<AuthenticationInfo?>
Looks up the AuthenticationInfo belonging to the key.
createSession(Session session, {required UuidValue authUserId, required String method, Set<Scope>? scopes, DateTime? expiresAt, Duration? expireAfterUnusedFor, bool skipUserBlockedChecked = false, Transaction? transaction}) Future<AuthSuccess>
Create a session for the user, returning the secret session key to be used for the authentication header.
destroyAllSessions(Session session, {required UuidValue authUserId, Transaction? transaction}) Future<void>
Signs out a user from the server and ends all user sessions managed by this module.
destroySession(Session session, {required UuidValue authSessionId, Transaction? transaction}) Future<void>
Removes the specified session and thus signs out its user on its device.
listSessions(Session session, {required UuidValue authUserId, Transaction? transaction}) Future<List<AuthSessionInfo>>
List all sessions belonging to the given authUserId.