-
-
Notifications
You must be signed in to change notification settings - Fork 494
Open
Description
I tried this example code passport-local-example and applied parameters to local strategy.
//express-4.x-local-example/server.js
passport.use(new LocalStrategy({
usernameField: 'email',
passwordField: 'passwd',
passReqToCallback: true,
session: false
}, function(req, username, password, done) {
// request object is now first argument
// ...
}));
However, it seems that session is still in use. I could get user's password from req.session.user.
Only username , password, callback are set in this lib.
//passport-local/lib/strategy.js
function Strategy(options, verify) {
if (typeof options == 'function') {
verify = options;
options = {};
}
if (!verify) { throw new TypeError('LocalStrategy requires a verify callback'); }
this._usernameField = options.usernameField || 'username';
this._passwordField = options.passwordField || 'password';
passport.Strategy.call(this);
this.name = 'local';
this._verify = verify;
this._passReqToCallback = options.passReqToCallback;
}
I don't have experience in security. Is it correct that I could get user's password in req.user.password?
Will this be unsafe?
wzup and othke
Metadata
Metadata
Assignees
Labels
No labels