TokenLocalDataSource class

Constructors

TokenLocalDataSource(TokenManager tokenManager)
Wrap an existing TokenManager instance. The TokenManager is preserved at its current deep-import path (package:vendure/src/vendure/token_manager.dart).

Properties

hashCode → int
The hash code for this object.
no setterinherited
rawTokenManager → TokenManager
Exposes the underlying TokenManager for advanced callers that need direct access (e.g., constructing a TokenFetcher closure).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
token → String?
Returns the current token, or null if none is set.
no setter

Methods

getValidToken() → Future<String?>
Returns a valid (non-expired) token, refreshing it via the configured TokenFetcher if necessary.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshToken(Map<String, dynamic> params) → Future<void>
Directly calls the configured TokenFetcher with the given params to refresh the token. Throws if no TokenFetcher is configured.
setToken(String token) → void
Sets the token and updates the expiry date based on the configured session duration.
toString() → String
A string representation of this object.
inherited

Operators

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