@pan-os/cerberus
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -21,3 +21,3 @@ /** | ||
const registerLocalStrategy = (passport, kind) => passport.use(kind, localStrategy); | ||
const registerLocalStrategy = (passport, kind) => (User) => passport.use(kind, localStrategy(User)); | ||
@@ -24,0 +24,0 @@ const registerFacebookStrategy = (passport) => passport.use('facebook', facebookStrategy); |
{ | ||
"name": "@pan-os/cerberus", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "security wrapper to protect routes dynamically with heimdall structure", | ||
@@ -28,2 +28,3 @@ "main": "index.js", | ||
"bcrypt": "^3.0.1", | ||
"bcryptjs": "^2.4.3", | ||
"jsonwebtoken": "^8.3.0", | ||
@@ -30,0 +31,0 @@ "passport-facebook": "^2.1.1", |
const LocalStrategy = require('passport-local').Strategy; | ||
const { lookupUser } = require('../utils') | ||
const localStrategy = () => new LocalStrategy({ usernameField: 'email', session: true }, lookupUser); | ||
const localStrategy = (User) => new LocalStrategy({ usernameField: 'email', session: true }, lookupUser(User)); | ||
module.exports = localStrategy; |
@@ -8,6 +8,2 @@ /* eslint-disable no-underscore-dangle */ | ||
const generateWebToken = require('../token'); | ||
/** | ||
* Models | ||
*/ | ||
const { User } = require('../../_models'); | ||
@@ -38,3 +34,3 @@ const authenticate = (plainPassword, user, done) => { | ||
module.exports = (email, password, done) => User.findOne({ email }, (err, user) => { | ||
module.exports = (email, password, done) => (User) => User.findOne({ email }, (err, user) => { | ||
if (!user) return done(null, false, { error: new InvalidCredentialsError(err) }); | ||
@@ -41,0 +37,0 @@ |
const generateWebToken = require('./token'); | ||
const lookupUser = require('./auth'); | ||
const {lookupUser} = require('./auth'); | ||
@@ -4,0 +4,0 @@ module.exports = { |
Sorry, the diff of this file is not supported yet
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
187258
7
146
+ Addedbcryptjs@^2.4.3
+ Addedbcryptjs@2.4.3(transitive)