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

Fixed error : Initialize a parameter #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ozumi
Copy link

@ozumi ozumi commented Jun 20, 2022

Description

I changed the location of a line of code to fix my error.
I am using Nest.js framework and tried to use the Authentication guard.
Since the bearer passport worked well, I changed it to custom bearer passport, but an error occurred.
[Nest] 61843 - 06/20/2022, 4:42:16 PM ERROR [ExceptionsHandler] Cannot set property 'headerName' of undefined TypeError: Cannot set property 'headerName' of undefined at verified (/node_modules/passport-http-custom-bearer/lib/strategy.js:156:24) at CustomBearerStrategy.<anonymous> (/node_modules/@nestjs/passport/dist/passport/passport.strategy.js:25:25) at Generator.next (<anonymous>) at fulfilled (/node_modules/@nestjs/passport/dist/passport/passport.strategy.js:5:58)

The reason for the error was that the info delivered as a parameter to the verified function was an undefined value. If the info is not delivered, the info should be initialized as an empty object. I moved the corresponding source code to the top of the function.

@charlesbodman
Copy link

@wwwslinger , same error as me. Can we get this merged in?

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

Successfully merging this pull request may close these issues.

2 participants