InMemoryTokenStore class

Default in-memory token storage.

Tokens are NOT persisted across app restarts. Use this for:

  • Testing
  • CLI tools that don't need persistence
  • Temporary anonymous sessions

For production Flutter apps, implement AuthTokenStore with SharedPreferences or FlutterSecureStorage.

Example:

final client = await SpacetimeDbClient.create(
  host: 'localhost:3000',
  database: 'mygame',
  authStorage: InMemoryTokenStore(), // Not persistent!
);
Implemented types

Constructors

InMemoryTokenStore()

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

clearToken() Future<void>
Clear the stored token (e.g., on logout).
override
loadToken() Future<String?>
Load the stored authentication token, if any.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
saveToken(String token) Future<void>
Save an authentication token.
override
toString() String
A string representation of this object.
inherited

Operators

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