dio_refresh_bot library

Classes

AuthStatus
Wrap user Status in class to include message in current user state
AuthToken
BotMemoryTokenStorage<T extends AuthToken>
Memory storage to store and retrieve tokens in memory. read, write, and delete the value from memory
BotTokenStorage<T extends AuthToken>
A token storage that extends BotStorage to store and retrieve tokens.
RefreshTokenInterceptor<T extends AuthToken>
TokenProtocol<T extends AuthToken>
Two functions wrapped in simple class when we should refresh or revoke the token this is a protocol :)

Enums

Status
User authentication status

Mixins

BotTokenStorageType<T>
A type mixin used in RefreshTokenInterceptor that extend BotStorage.delete behavior with message parameter.
RefreshBotMixin<T extends AuthToken>
Mixin add reactive behavior to BotStorageMixin

Typedefs

DeleteTokenCallback<T> = FutureOr<String?> Function()
Callback for delete stored value from storage and return optional message
RefreshToken<T> = Future<T> Function(T token, Dio tokenDio)
Function for refresh token and return a new one
RevokeCallback = String? Function(DioError error)
Function for Taking the the an action when the token is revoked
ShouldRefresh<T> = bool Function(Response? response, T? token)
Function to decide if we need to refresh token depending on Response and token value
ShouldRevoke = bool Function(DioError error)
Function to decide when we should revoke the token depending on DioError
TokenHeaderBuilder<T> = Map<String, String> Function(T token)
Function responsible for building the token header.