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

client-oauth2

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

client-oauth2 - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

2

package.json
{
"name": "client-oauth2",
"version": "3.0.1",
"version": "3.0.2",
"description": "Straight-forward execution of OAuth 2.0 flows and authenticated API requests",

@@ -5,0 +5,0 @@ "main": "src/client-oauth2.js",

@@ -50,3 +50,2 @@ # Client OAuth 2.0

* **headers** An object to merge with the headers of every request
* **transport** Change certain request transport behaviour (currently `rejectUnauthorized` and `agent`)

@@ -53,0 +52,0 @@ To re-create an access token instance and make requests on behalf on the user, you can create an access token instance by using the `createToken` method on a client instance.

@@ -137,2 +137,16 @@ var extend = require('xtend')

/**
* Attempt to parse response body as JSON, fall back to parsing as a query string.
*
* @param {String} body
* @return {Object}
*/
function parseResponseBody (body) {
try {
return JSON.parse(body)
} catch (e) {
return Querystring.parse(body)
}
}
/**
* Sanitize the scopes option to be a string.

@@ -202,4 +216,3 @@ *

query: extend(options.query, requestOptions.query),
headers: extend(options.headers, requestOptions.headers),
transport: extend(options.transport, requestOptions.transport)
headers: extend(options.headers, requestOptions.headers)
})

@@ -272,12 +285,6 @@ }

err.status = res.status
err.body = res.body
err.body = parseResponseBody(res.body)
return Promise.reject(err)
}
// Attempt to parse as JSON, fall back to parsing as a query string.
try {
return JSON.parse(res.body)
} catch (e) {
return Querystring.parse(res.body)
}
return parseResponseBody(res.body)
})

@@ -322,3 +329,3 @@ }

*
* @param {Object} requestOptions
* @param {Object} requestObject
* @return {Object}

@@ -325,0 +332,0 @@ */

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