TokenCache class

Internal token cache for storing authentication tokens Uses FlutterSecureStorage for persistent storage

Constructors

TokenCache({AndroidOptions? androidOptions, IOSOptions? iosOptions, LinuxOptions? linuxOptions, WebOptions? webOptions, WindowsOptions? windowsOptions})

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

clearAll() → Future<void>
Clear all cached tokens
getAccessToken() → Future<Token?>
Get access token from cache Returns null if token is expired or not found
getCSRFCookie() → Future<String?>
getCSRFToken() → Future<String?>
Get CSRF token from cache
getRefreshToken() → Future<Token?>
Get refresh token from cache Returns null if token is expired or not found
initialize() → Future<void>
Initialize cache by loading values from storage
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAccessToken(String? token, {int? expiresAt}) → Future<void>
Set access token to cache If token is null, removes it from cache expiresAt is optional expiration timestamp in milliseconds since epoch
setCSRFCookie(String? cookie, {int? expiresAt}) → Future<void>
Set CSRF token to cache If token is null, removes it from cache expiresAt is optional expiration timestamp in milliseconds since epoch
setRefreshToken(String? token, {int? expiresAt}) → Future<void>
Set refresh token to cache If token is null, removes it from cache expiresAt is optional expiration timestamp in milliseconds since epoch
toString() → String
A string representation of this object.
inherited

Operators

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