question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: No auth token - is not set as Error

See original GitHub issue

If there is no Authentication header, the passport.authenticate()-callback gets set the info parameter to Error: No auth token. But the 1st error parameter is undef.
Shouldn’t the error parameter be an error if an error occurs?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Acerbiccommented, Oct 19, 2019

@mikenicholson

See the documentation for Strategy.error() and Strategy.fail().

That documenation states that fail() should be called with arguments of types String, Number, and error() with argument of type Error. You, however, pass an Error object to fail().

Perhaps, instead of

return self.fail(new Error("No auth token"));

you should be doing

return self.fail("No auth token", 401);

?

1reaction
mikenicholsoncommented, Nov 9, 2018

@jerroydmoore I really like the idea of switching to an extractor function that accepts a done callback rather than simply returning the JWT.

I’ll probably have to wait until I get some time around the holidays to get around this but PR’s are welcome if they maintain the existing level of test coverage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No auth token - is not set as Error · Issue #160 - GitHub
If there is no Authentication header, the passport.authenticate()-callback gets set the info parameter to Error: No auth token.
Read more >
No auth token on service query even after success login
Querying using postman works but querying using nuxtjs returns the message No auth token. I have already opened a ticket on github repo....
Read more >
Troubleshoot Invalid Token Errors - Auth0
If you don't ask for an access token when authenticating, you will receive the following error: The id_token cannot be validated because it...
Read more >
Resolve API Gateway REST API 403 “Missing Authentication ...
API Gateway REST API endpoints return Missing Authentication Token errors for the following reasons: The API request is made to a method or ......
Read more >
Access Token Error Response and Codes - Tutorialspoint
Access token is a type of token that is assigned by the authorization server. The authorization server issues the access token, if the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found