jaredhanson / passport-local

Username and password authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-local/?utm_source=github&utm_medium=referral&utm_campaign=passport-local&utm_content=about
MIT License
2.73k stars 498 forks source link

session: false doesn't work #155

Open wzup opened 7 years ago

wzup commented 7 years ago

Session: false is not working. Your docs say it should be specified in options. But that's not true. It doesn't work that way.

passport.use(new LocalStrategy({
    usernameField: 'email',
    passwordField: 'passwd',
    session: false
  },
  function(username, password, done) {
    // ...
  }
));

Either change docs of modify the code. Because it has to be like this, not in initial config

passport.authenticate('local', {session:false})
marcellino-ornelas commented 5 years ago

Any progress on this running into this same problem?

TeodorKolev commented 4 years ago

Same here

ritlew commented 4 years ago

Running into this issue as well, can this get some attention?

TiruvedulaMithun commented 3 years ago

The same problem here, it's causing 100s of unwanted sessions between backend APIs, please help! @jaredhanson

gunhaxxor commented 3 years ago

Same here. Looking in the source code I can't see anywhere where the session-option is actually used 🤔

https://github.com/jaredhanson/passport-local/blob/4d9fbefeba48164c43d5bde4e48ff57c2c37d372/lib/strategy.js#L42-L56

MarvinXu commented 1 year ago

Same here. Looking in the source code I can't see anywhere where the session-option is actually used 🤔

https://github.com/jaredhanson/passport-local/blob/4d9fbefeba48164c43d5bde4e48ff57c2c37d372/lib/strategy.js#L42-L56

Looks like a documentation error.

session: false option only works in passport.authenticate('local', { session: false })