Socket
Socket
Sign inDemoInstall

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 2.1.0 to 2.2.0

30

client-oauth2.js

@@ -483,13 +483,13 @@ var extend = require('xtend')

// Make sure the uri matches our expected redirect uri.
if (uri.substr(0, options.redirectUri.length) !== options.redirectUri) {
return Promise.reject(new Error('Should match redirect uri: ' + uri))
var url = parseUrl(uri)
var expectedUrl = parseUrl(options.redirectUri)
if (url.pathname !== expectedUrl.pathname) {
return Promise.reject(new TypeError('Should match redirect uri: ' + uri))
}
var url = parseUrl(uri)
// If no query string or fragment exists, we won't be able to parse
// any useful information from the uri.
if (!url.hash && !url.search) {
return Promise.reject(new Error('Unable to process uri: ' + uri))
return Promise.reject(new TypeError('Unable to process uri: ' + uri))
}

@@ -514,3 +514,3 @@

if (state != null && data.state !== state) {
return Promise.reject(new Error('Invalid state: ' + data.state))
return Promise.reject(new TypeError('Invalid state: ' + data.state))
}

@@ -610,11 +610,11 @@

// Make sure the uri matches our expected redirect uri.
if (uri.substr(0, options.redirectUri.length) !== options.redirectUri) {
return Promise.reject(new Error('Should match redirect uri: ' + uri))
var url = parseUrl(uri)
var expectedUrl = parseUrl(options.redirectUri)
if (url.pathname !== expectedUrl.pathname) {
return Promise.reject(new TypeError('Should match redirect uri: ' + uri))
}
var url = parseUrl(uri)
if (!url.search) {
return Promise.reject(new Error('Unable to process uri: ' + uri))
return Promise.reject(new TypeError('Unable to process uri: ' + uri))
}

@@ -630,3 +630,3 @@

if (state && data.state !== state) {
return Promise.reject(new Error('Invalid state:' + data.state))
return Promise.reject(new TypeError('Invalid state:' + data.state))
}

@@ -636,3 +636,3 @@

if (!data.code) {
return Promise.reject(new Error('Missing code, unable to request token'))
return Promise.reject(new TypeError('Missing code, unable to request token'))
}

@@ -639,0 +639,0 @@

{
"name": "client-oauth2",
"version": "2.1.0",
"version": "2.2.0",
"description": "Straight-forward execution of OAuth 2.0 flows and authenticated API requests",

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

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

var express = require('express')
var app = express()
var app = express()

@@ -80,0 +80,0 @@ app.get('/auth/github', function (req, res) {

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