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

request.authInfo is undefined when trying to get from callback's request #1740

Open
2 of 4 tasks
ghmendonca opened this issue Aug 28, 2024 · 0 comments
Open
2 of 4 tasks
Labels
bug Something isn't working needs triage

Comments

@ghmendonca
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When I pass some data in the authInfo parameter, I expect the authInfo to be passed to the callback's request object in my controller so I can do some logic with it. Right now, it's always undefined. It's weird that if I add the handleRequest function in my guard and log the authInfo from the request there, the value is right, but for some reason inside my controller it's always undefined.

Minimum reproduction code

https://github.com/ghmendonca/nestjs-auth-info

Steps to reproduce

  1. Make sure to set the google environment variables in a .env file.
  2. Send a request to auth/google and see that the log from request.authInfo is undefined

Expected behavior

NestJS Passport module should forward the authInfo field from the request to the controller

Package version

10.0.3

Passport version

0.7.0

NestJS version

10.0.0

Node.js version

18.20.4

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@ghmendonca ghmendonca added bug Something isn't working needs triage labels Aug 28, 2024
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

1 participant