@passport-next/passport
Advanced tools
+7
-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 |
+8
-8
| { | ||
| "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": { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
124260
0.2%1534
0.33%