mikenicholson / passport-jwt

Passport authentication using JSON Web Tokens
MIT License
1.97k stars 214 forks source link

TypeError: Cannot read property 'authorization' of undefined #120

Closed teckays closed 7 years ago

teckays commented 7 years ago

Would be nice to do a safe-check at this line if (request.headers[AUTH_HEADER]) since some requests don't support custom headers (websocket for example) so even though I have an extractor that matches my request, the headers extractor fails because there's no request.headers object present.

mikenicholson commented 7 years ago

I'm not sure I understand the problem. The provided extractors are just there to cover common cases, if you have a condition where one of the provided extractors doesn't do what you want it to you can simply write your own.

Are you trying to use multiple extractors together? Some code illustrating how you construct the strategy might help me to understand what you're trying to do.

mikenicholson commented 7 years ago

@teckays does writing a custom extractor solve the problem?