RefreshTokenInterceptor<T extends AuthToken> class

Constructors

RefreshTokenInterceptor({required BotTokenStorageType<T> tokenStorage, required RefreshToken<T> refreshToken, RevokeCallback? onRevoked, TokenProtocol<AuthToken> tokenProtocol = const TokenProtocol(), Dio? tokenDio, bool debugLog = false, TokenHeaderBuilder? tokenHeaderBuilder})

Properties

debugLog bool
If it is enabled will print logs during refresh token request.
final
hashCode int
The hash code for this object.
no setterinherited
onRevoked RevokeCallback?
This function will be triggered if the token revoked and the refresh token is failed.
final
refreshToken RefreshToken<T>
This function called when we should refresh the token and Its returns a new token
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokenHeaderBuilder TokenHeaderBuilder?
Function for building custom token header depending on stored token
final
tokenProtocol TokenProtocol<AuthToken>
The TokenProtocol for refresh token process
final
tokenStorage BotTokenStorageType<T>
Interface API class to read, write and delete token from storage or memory
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onError(DioError err, ErrorInterceptorHandler handler) Future<void>
The callback will be executed on error.
onRequest(RequestOptions options, RequestInterceptorHandler handler) Future<void>
The callback will be executed before the request is initiated.
onResponse(Response response, ResponseInterceptorHandler handler) → void
The callback will be executed on success. If you want to continue the response, call handler.next.
inherited
toString() String
A string representation of this object.
inherited

Operators

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