New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fetch-mw-oauth2

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-mw-oauth2 - npm Package Compare versions

Comparing version 0.3.1 to 0.3.3

browser/fetch-mw-oauth2.min.js.gz

14

changelog.md
Changelog
=========
0.3.3 (2019-03-18)
------------------
* When refreshing a token, browsers don't allow re-use of the same `Request`
object. Now we're cloning it before use.
0.3.2 (2019-03-13)
------------------
* When refreshing a token, and there's no `client_secret`, the `client_id`
must be sent in the body.
0.3.1 (2019-03-13)

@@ -5,0 +19,0 @@ ------------------

9

dist/fetch-wrapper.js

@@ -28,3 +28,3 @@ "use strict";

let accessToken = await this.getAccessToken();
let response = await requestWithBearerToken(request, accessToken);
let response = await requestWithBearerToken(request.clone(), accessToken);
if (!response.ok && response.status === 401) {

@@ -35,3 +35,3 @@ accessToken = await this.refreshToken();

}
return fetch(request);
return response;
}

@@ -63,2 +63,7 @@ /**

};
if (!this.options.clientSecret) {
// If there is no secret, it means we need to send the clientId along
// in the body.
body.client_id = this.options.clientId;
}
}

@@ -65,0 +70,0 @@ else {

@@ -72,2 +72,3 @@ /**

scope?: string;
client_id?: string;
} | {

@@ -74,0 +75,0 @@ grant_type: 'authorization_code';

{
"name": "fetch-mw-oauth2",
"version": "0.3.1",
"version": "0.3.3",
"description": "Fetch middleware to add OAuth2 support",

@@ -24,6 +24,6 @@ "main": "dist/index.js",

"devDependencies": {
"@types/node": "^11.11.1",
"@types/node": "^11.11.3",
"awesome-typescript-loader": "^5.2.1",
"node-fetch": "^2.3.0",
"tslint": "^5.13.1",
"tslint": "^5.14.0",
"typescript": "^3.3.3333",

@@ -30,0 +30,0 @@ "webpack": "^4.29.6",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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