fresh 0.1.0 copy "fresh: ^0.1.0" to clipboard
fresh: ^0.1.0 copied to clipboard

outdated

An http interceptor for token refresh. Fresh is built on top of package:dio and manages authentication tokens transparently.

Fresh 🍋 #

Pub build coverage style: effective dart License: MIT


A dio interceptor for built-in token refresh.

Overview #

Fresh is a dio interceptor which attempts to simplify custom API authentication by integrating token refresh and caching transparently. Fresh is flexible and is intended to support custom token refresh mechanisms.

Usage #

dio.interceptors.add(
  Fresh<OAuth2Token>(
    tokenStorage: InMemoryTokenStorage(),
    refreshToken: (token, client) {
      // Perform refresh and return new token
    },
  ),
);

Example #

See the example for a complete sample application using fresh which integrates with jsonplaceholder.

126
likes
0
pub points
80%
popularity

Publisher

verified publisherfelangel.dev

An http interceptor for token refresh. Fresh is built on top of package:dio and manages authentication tokens transparently.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

dio, meta

More

Packages that depend on fresh