RefreshTokensDelegate class abstract
Delegete that provide a set methods for controlling the process of refreshing authorisation tokens.
- Implementers
Constructors
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
-
appendAccessTokenToRequest(
Options options, TokenPair? tokenPair) → Options - Calls to attach access token to authorised request.
-
getTokens(
) → Future< TokenPair> - Load from storage already received and saved token pair for continuing a user session.
-
isAccessTokenExpired(
DioException error) → bool - Calls to determine if the request failed because the access token expired or not. If so, the refresh token process will be started.
-
isRefreshTokenExpired(
DioException error) → bool -
Calls to determine if the request failed
because the refresh token expired or not.
If so,
onTokensRefreshingFailed
will be called. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onTokensRefreshingFailed(
) → void - This method will be called when API cannot update token pair because of the refresh token is expired. User should be redirected to sign-in screen in that case.
-
refreshTokens(
Dio dio, TokenPair tokenPair) → Future< TokenPair> - Request for tokens refreshing.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateTokens(
TokenPair tokenPair) → Future< void> - Calls when the API returns a new tokens pair. Save tokens to storage here for continuing user session later.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited