Skip to content

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

Open
@ghmendonca

Description

@ghmendonca

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions