@passport-next/passport
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -5,2 +5,9 @@ This changelog follows Semantic Versioning https://semver.org/ | ||
# 3.1.0 | ||
### Minor | ||
* Feature: Pass instantiated strategy to authenticate. @rwky @jaredhanson @ayZagen | ||
* Updated npm deps @rwky | ||
# 3.0.1 | ||
@@ -7,0 +14,0 @@ |
@@ -180,2 +180,3 @@ /* eslint-disable no-shadow */ | ||
(function attempt(i) { | ||
let strategy; | ||
const layer = name[i]; | ||
@@ -188,8 +189,11 @@ // If no more strategies exist in the chain, authentication has failed. | ||
// within the context of the HTTP request/response pair. | ||
const prototype = passport._strategy(layer); | ||
if (!prototype) { return next(new Error(`Unknown authentication strategy "${layer}"`)); } | ||
if (typeof layer.authenticate === 'function') { | ||
strategy = layer; | ||
} else { | ||
const prototype = passport._strategy(layer); | ||
if (!prototype) { return next(new Error(`Unknown authentication strategy "${layer}"`)); } | ||
const strategy = Object.create(prototype); | ||
strategy = Object.create(prototype); | ||
} | ||
// ----- BEGIN STRATEGY AUGMENTATION ----- | ||
@@ -196,0 +200,0 @@ // Augment the new strategy instance with action functions. These action |
{ | ||
"name": "@passport-next/passport", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Simple, unobtrusive authentication for Node.js.", | ||
@@ -25,4 +25,4 @@ "author": { | ||
"chai": "4.x.x", | ||
"coveralls": "^3.0.6", | ||
"eslint": "^6.3.0", | ||
"coveralls": "^3.0.9", | ||
"eslint": "^6.7.2", | ||
"eslint-config-standard": "^14.1.0", | ||
@@ -33,5 +33,5 @@ "eslint-plugin-array-func": "^3.1.3", | ||
"eslint-plugin-html": "^6.0.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jsdoc": "^15.9.1", | ||
"eslint-plugin-markdown": "^1.0.0", | ||
"eslint-plugin-import": "^2.19.1", | ||
"eslint-plugin-jsdoc": "^15.12.2", | ||
"eslint-plugin-markdown": "^1.0.1", | ||
"eslint-plugin-no-use-extend-native": "^0.4.1", | ||
@@ -43,6 +43,6 @@ "eslint-plugin-node": "^10.0.0", | ||
"eslint-plugin-unicorn": "^10.0.0", | ||
"mocha": "6.x.x", | ||
"mocha": "^6.2.2", | ||
"nunjucks": "^3.2.0", | ||
"nyc": "^14.1.1", | ||
"typescript": "^3.6.2" | ||
"typescript": "^3.7.3" | ||
}, | ||
@@ -49,0 +49,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124260
1534