Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session: false doesn't work #155

Open
wzup opened this issue Jun 29, 2017 · 6 comments
Open

session: false doesn't work #155

wzup opened this issue Jun 29, 2017 · 6 comments

Comments

@wzup
Copy link

wzup commented Jun 29, 2017

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
Copy link

Any progress on this running into this same problem?

@TeodorKolev
Copy link

Same here

@ritlew
Copy link

ritlew commented Sep 24, 2020

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

@TiruvedulaMithun
Copy link

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

@gunhaxxor
Copy link

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

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;
}

@MarvinXu
Copy link

MarvinXu commented Dec 1, 2022

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

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;
}

Looks like a documentation error.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants