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.

Unless is not working

See original GitHub issue

I have a route which is /authenticate

I have defined it as

app.use(expressjwt({secret: config.sessionSecret}).unless({path: ['/authenticate']}));

But when I do a post to /authenticate path it give me an error saying

UnauthorizedError: No authorization token was found
...

/authenticate is working without express-jwt

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
xiantankcommented, Jan 17, 2018

/authenticate will redirect to /authenticate/

try add slash to end of path

change to app.use(expressjwt({secret: config.sessionSecret}).unless({path: ['/authenticate/']}));

2reactions
okononcommented, May 3, 2017

I had same problem. Try setting strict: false in your configuration object @iamchathu

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ruby on Rails 'unless' not working - Stack Overflow
The problem in that the headers are showing when there is no tests, e.g. the completed tests header is showing when there are...
Read more >
#Unless is not working - Meteor forums
Hi,. As you can see I have no customers in my collection. So why does this code not work? Template.OEMPartner.helpers({ customers() { return ......
Read more >
puppet logical conditions- "onlyif" and "unless" not working
I tried adding conditions using onlyif and unless which are commented in the following code but none of them seem to be working...
Read more >
Unless - Grammar - Cambridge Dictionary
We use the conjunction unless to mean 'except if'. The clause which follows unless is a subordinate clause (sc): it needs a main...
Read more >
"unless" statement inside of "if" statement not working - Ruby
if hungry != true, the unless statement SHOULD run the else statement which puts “time to eat!” and then there is an “end”...
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