We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Under "Custom Callback" in http://passportjs.org/guide/authenticate.html, the docs mention "… it becomes the application's responsibility to establish a session".
Since passport has already implemented this, it makes sense to just invoke it from the app.
The following code, adopted from in middleware/authenticate.js, seems to do the trick:
middleware/authenticate.js
req.logIn(user, function (err) { if (err) { throw err; } // Session is established; redirect to destination or do something else });
If this indeed correct, I think it's worthwhile to document it? Otherwise, is there a better way to do this?
The text was updated successfully, but these errors were encountered:
That's exactly right. Thanks for the report, I'll be sure to get clarify this in my next pass over the documentation.
Sorry, something went wrong.
I've updated the guide to include this info. Thanks for the report!
No branches or pull requests
Under "Custom Callback" in http://passportjs.org/guide/authenticate.html, the docs mention "… it becomes the application's responsibility to establish a session".
Since passport has already implemented this, it makes sense to just invoke it from the app.
The following code, adopted from in
middleware/authenticate.js
, seems to do the trick:If this indeed correct, I think it's worthwhile to document it? Otherwise, is there a better way to do this?
The text was updated successfully, but these errors were encountered: