fresh_graphql library

Classes

A GraphQL Link which handles manages an authentication token automatically.
InMemoryTokenStorage<T>
A TokenStorage implementation that keeps the token in memory.
OAuth2Token
Standard OAuth2Token as defined by https://www.oauth.com/oauth2-servers/access-tokens/access-token-response/ with added support for the issue date.
Token
Base class for all authentication tokens.
TokenStorage<T>
An interface which must be implemented to read, write, and delete the Token.

Enums

AuthenticationStatus
Enum representing the current authentication status of the application.

Typedefs

RefreshToken<T> = Future<T> Function(T, Client)
Signature for refreshToken on FreshLink.
ShouldRefresh = bool Function(Response)
Signature for shouldRefresh on FreshLink.
ShouldRefreshBeforeRequest<T> = bool Function(Request request, T? token)
Signature for shouldRefreshBeforeRequest on FreshLink.
TokenHeaderBuilder<T> = Map<String, String> Function(T token)
Function responsible for building the token header(s) give a token.

Exceptions / Errors

RevokeTokenException
An Exception that should be thrown in FreshMixin.performTokenRefresh if the refresh fails and should result in a force-logout.