Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shoutem/fetch-token-intercept

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shoutem/fetch-token-intercept - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc