View Source Squeeze.Fitbit.Middleware.RefreshToken (OpenPace v0.0.1)

Tesla middleware that handles OAuth2 token refresh for Fitbit API requests.

When a request receives a 401 Unauthorized response, this middleware:

  1. Attempts to refresh the access token using the provided refresh token
  2. Updates the request headers with the new access token
  3. Retries the original request
  4. Calls an optional callback with the new token information

options

Options

  • :refresh_token - The OAuth2 refresh token to use for token refresh
  • :token_refreshed - Optional callback function that receives the new OAuth2.Client

Link to this section Summary

Functions

Handles the middleware processing of the request.

Link to this section Functions

Handles the middleware processing of the request.