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.7.6 to 0.7.7

6

changelog.md
Changelog
=========
0.7.7 (2021-02-22)
------------------
* Last version did not correctly build it's files.
0.7.6 (2021-02-22)

@@ -5,0 +11,0 @@ ------------------

23

dist/util.js

@@ -86,3 +86,5 @@ "use strict";

};
let usesBasicAuth = false;
if (options.clientSecret !== undefined) {
usesBasicAuth = true;
const basicAuthStr = base64_1.encode(options.clientId + ':' + options.clientSecret);

@@ -103,7 +105,20 @@ headers.Authorization = 'Basic ' + basicAuthStr;

}
let errorMessage = 'OAuth2 error ' + jsonResult.error + '.';
if (jsonResult.error_description) {
errorMessage += ' ' + jsonResult.error_description;
const httpError = authResult.status;
let errorMessage;
let oauth2Code;
if (jsonResult.error) {
errorMessage = 'OAuth2 error ' + jsonResult.error + '.';
if (jsonResult.error_description) {
errorMessage += ' ' + jsonResult.error_description;
}
oauth2Code = jsonResult.error;
}
throw new error_1.default(errorMessage, jsonResult.error, 401);
else {
errorMessage = 'HTTP Error ' + authResult.status + ' ' + authResult.statusText;
if (authResult.status === 401 && usesBasicAuth) {
errorMessage += '. It\'s likely that the clientId and/or clientSecret was incorrect';
}
oauth2Code = null;
}
throw new error_1.default(errorMessage, oauth2Code, httpError);
}

@@ -110,0 +125,0 @@ const newToken = {

2

package.json
{
"name": "fetch-mw-oauth2",
"version": "0.7.6",
"version": "0.7.7",
"description": "Fetch middleware to add OAuth2 support",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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