BearerStrategy class
Reads the JWT access token from memory (fast) with a Hive fallback
(persistent). Attaches it as Authorization: Bearer <token>.
The app creator saves the token after login:
await BearerStrategy.saveToken(token);
- Inheritance
-
- Object
- AuthStrategy
- BearerStrategy
Constructors
- BearerStrategy({required String tokenKey})
Properties
Methods
-
apply(
RequestOptions options) → Future< void> -
Attach auth credentials to
optionsbefore the request is sent.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
Called when the API layer receives a 401.
Use to trigger token refresh or logout in your app provider.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited