token_manager_gql 0.1.2
token_manager_gql: ^0.1.2 copied to clipboard
Single-flight OAuth/JWT refresh for GraphQL: a gql_link Link that attaches the access token, refreshes once on a rejection and replays the request.
Changelog #
0.1.2 #
Clearer description, topics and recipes.
0.1.1 #
- Fix: a 403 whose GraphQL errors carry
extensions.code: UNAUTHENTICATEDis now replayed once with refreshed tokens; before, it reached the caller as aServerException. A 403 without that code is still not replayed. - Fix: the manager's failures (
NotAuthenticated,InvalidGrant,Transient) now arrive as aLinkExceptionwhoseoriginalExceptionis the failure; before, they arrived as the raw failure object. - Docs: how to opt in to other rejections with
AuthFailureMatcher. - Docs: the
clientsdartdoc category now listsTokenManagerLinkandSkipAuthorization.
0.1.0 #
Initial release of the GraphQL adapter for token_manager.
TokenManagerLink<T>, agql_linkLinkthat attaches the tokens of aTokenManager<T>and replays a request once after the server rejects them, on an error event or on a response without data whose errors carry an auth code.AuthFailureMatcher, which recognises a rejection: HTTP 401 and theUNAUTHENTICATEDerror code by default.SkipAuthorization, a request context entry for operations sent without tokens, such as a login.TokenManagerSocketAuth<T>, theinitialPayloadandonConnectionLostcallbacks for GraphQL WebSocket clients.