SessionModule class

Module for handling session management operations.

This module provides methods for viewing and managing authenticated sessions, including listing all sessions and revoking sessions.

Obtain an instance from BetterAuthClient.session:

final sessions = await authClient.session.list();

Constructors

SessionModule(Dio _dio, StorageInterface _storage)
Creates a new SessionModule instance.

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

get() → Future<AuthResponse<Session>>
Gets the current session.
list() → Future<AuthResponse<List<Session>>>
Lists all sessions for the current user.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
revoke(String sessionId) → Future<AuthResponse<void>>
Revokes a specific session by ID.
revokeOthers() → Future<AuthResponse<void>>
Revokes all sessions except the current one.
toString() → String
A string representation of this object.
inherited

Operators

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