@shoutem/fetch-token-intercept
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "@shoutem/fetch-token-intercept", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Fetch interceptor for managing refresh token flow.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -31,24 +31,24 @@ # fetch-token-intercept | ||
config: { | ||
//(Required) Prepare fetch request for renewing new access token | ||
// (Required) Prepare fetch request for renewing new access token | ||
createAccessTokenRequest: (refreshToken) => request, | ||
//(Required) Parses access token from access token response | ||
// (Required) Parses access token from access token response | ||
parseAccessToken: (response) => accessToken, | ||
//(Required) Defines whether interceptor will intercept this request or just let it pass through | ||
// (Required) Defines whether interceptor will intercept this request or just let it pass through | ||
shouldIntercept: (request) => boolean, | ||
//(Required) Defines whether access token will be invalidated after this response | ||
// (Required) Defines whether access token will be invalidated after this response | ||
shouldInvalidateAccessToken: (response) => boolean, | ||
//(Required) Adds authorization for intercepted requests | ||
// (Required) Adds authorization for intercepted requests | ||
authorizeRequest: (request) => authorizedRequest, | ||
//Number of retries after initial request was unauthorized | ||
// Number of retries after initial request was unauthorized | ||
fetchRetryCount: 1, | ||
//Event invoked when access token has changed | ||
// Event invoked when access token has changed | ||
onAccessTokenChange: null, | ||
//Event invoked when response is resolved | ||
// Event invoked when response is resolved | ||
onResponse: null, | ||
@@ -58,3 +58,3 @@ } | ||
All required methods support returning a promise to enable reading of body. | ||
All required methods return a promise to enable reading of request or response body. | ||
You should avoid reading the body directly on provided requests and responses and instead clone | ||
@@ -61,0 +61,0 @@ them first. The library does not clone objects to avoid unnecessary overhead in cases where |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46020