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

client-oauth2

Package Overview
Dependencies
Maintainers
1
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 0.0.1 to 0.0.2

22

client-oauth2.js

@@ -268,2 +268,16 @@ (function (root) {

/**
* Sanitize the scopes option to be a string.
*
* @param {Array} scopes
* @return {String}
*/
function sanitizeScope (scopes) {
if (!Array.isArray(scopes)) {
return scopes == null ? null : String(scopes);
}
return scopes.join(' ');
}
/**
* Construct an object that can handle the multiple OAuth 2.0 flows.

@@ -589,3 +603,3 @@ *

body: uriEncode({
scope: options.scope,
scope: sanitizeScope(options.scopes),
username: username,

@@ -634,3 +648,3 @@ password: password,

state: options.state,
scope: options.scope,
scope: sanitizeScope(options.scopes),
client_id: options.clientId,

@@ -741,3 +755,3 @@ redirect_uri: options.redirectUri,

body: uriEncode({
scope: options.scope,
scope: sanitizeScope(options.scopes),
grant_type: 'client_credentials'

@@ -783,3 +797,3 @@ })

state: options.state,
scope: options.scope,
scope: sanitizeScope(options.scopes),
client_id: options.clientId,

@@ -786,0 +800,0 @@ redirect_uri: options.redirectUri,

2

package.json
{
"name": "client-oauth2",
"version": "0.0.1",
"version": "0.0.2",
"description": "A no-dependency library for executing OAuth 2.0 flows.",

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

@@ -25,3 +25,3 @@ # Client OAuth 2.0

redirectUri: 'http://example.com/auth/github/callback',
scope: 'notifications'
scopes: ['notifications', 'gist']
});

@@ -28,0 +28,0 @@ ```

@@ -9,3 +9,3 @@ describe('code', function () {

redirectUri: 'http://example.com/auth/callback',
scope: 'notifications'
scopes: ['notifications']
});

@@ -12,0 +12,0 @@

@@ -9,3 +9,3 @@ describe('credentials', function () {

redirectUri: 'http://example.com/auth/callback',
scope: 'notifications'
scopes: ['notifications']
});

@@ -12,0 +12,0 @@

@@ -9,3 +9,3 @@ describe('token', function () {

redirectUri: 'http://example.com/auth/callback',
scope: 'notifications'
scopes: 'notifications'
});

@@ -12,0 +12,0 @@

@@ -9,3 +9,3 @@ describe('user token instance', function () {

redirectUri: 'http://example.com/auth/callback',
scope: 'notifications'
scopes: ['notifications']
});

@@ -12,0 +12,0 @@

@@ -13,3 +13,3 @@ var nock = require('nock');

redirectUri: 'http://example.com/auth/callback',
scope: 'notifications'
scopes: 'notifications'
});

@@ -16,0 +16,0 @@

@@ -13,3 +13,3 @@ var nock = require('nock');

redirectUri: 'http://example.com/auth/callback',
scope: 'notifications'
scopes: ['notifications']
});

@@ -16,0 +16,0 @@

@@ -12,3 +12,3 @@ var expect = require('chai').expect;

redirectUri: 'http://example.com/auth/callback',
scope: 'notifications'
scopes: ['notifications']
});

@@ -15,0 +15,0 @@

@@ -13,3 +13,3 @@ var nock = require('nock');

redirectUri: 'http://example.com/auth/callback',
scope: 'notifications'
scopes: 'notifications'
});

@@ -16,0 +16,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