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

Document how to establish sessions manually #10

Closed
thatmarvin opened this issue Jan 26, 2012 · 2 comments
Closed

Document how to establish sessions manually #10

thatmarvin opened this issue Jan 26, 2012 · 2 comments

Comments

@thatmarvin
Copy link

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:

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?

@jaredhanson
Copy link
Owner

That's exactly right. Thanks for the report, I'll be sure to get clarify this in my next pass over the documentation.

@jaredhanson
Copy link
Owner

I've updated the guide to include this info. Thanks for the report!

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

2 participants