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

Unable to preserve session in passport v0.6.0 #1385

Closed
2 of 4 tasks
gaiuaurelian opened this issue Aug 16, 2023 · 2 comments
Closed
2 of 4 tasks

Unable to preserve session in passport v0.6.0 #1385

gaiuaurelian opened this issue Aug 16, 2023 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@gaiuaurelian
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Hello,

Passport 0.6.0 introduced this fix for a security issue described in this blog post.
https://medium.com/passportjs/fixing-session-fixation-b2b68619c51d

I tried to pass the keepSessionInfo property in the following places

  • PassportModule.register function
  • Inside a super call of a guard that extends AuthGuard
  • Inside getAuthenticateOptions method of the Guard

The options are passed in the authenticate call but they are not passed inside passportjs sessionManager.logIn.

I used the examples in this blogpost https://medium.com/passportjs/fixing-session-fixation-b2b68619c51d

Minimum reproduction code

https://github.com/sdoxsee/cats-nest

Steps to reproduce

No response

Expected behavior

The options set for passport.authenticate call should also be passed to req.login function inside the logIn method of the AuthGuard

Package version

10.0.0

Passport version

0.6.0

NestJS version

10.0.0

Node.js version

18.17.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@gaiuaurelian
Copy link
Contributor Author

I created a pull request for fixing this issue

@kamilmysliwiec
Copy link
Member

Let's track this here #1386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants