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

[Post] How to regenerate session ID when logging in with Express.js + Passport.js #134

Open
anoriqq opened this issue May 17, 2020 · 0 comments
Assignees
Labels
post New post

Comments

@anoriqq
Copy link
Owner

anoriqq commented May 17, 2020

  • How to regenerate session ID when logging in with Express.js + Passport.js
const app = express();

app.get(
  '/auth',
  (req, res, next) => {
    if (!req.session) return next();
    return req.session.regenerate((err) => {
      if (err) throw err;
      return next();
    });
  },
  passport.authenticate('google', { scope: ['profile'] }),
);
@anoriqq anoriqq self-assigned this May 17, 2020
@anoriqq anoriqq added the post New post label May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
post New post
Projects
None yet
Development

No branches or pull requests

1 participant