You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @Nishant-Dwivedi , thanks for suggesting. I think the current logic is correct though — the ! is intentional because we want to block requests that are missing the x-auth header.
Also, we use next('router') to skip the rest of the router if the header is missing, so it falls through to the 401 handler.
I think we need to improve our documentation on next().
Cc @expressjs/docs-wg
Description
Expectations
I could be wrong but i think you need to either remove the bang in front of
req.headers['x-auth']
or swapnext('route')
withnext()
.The text was updated successfully, but these errors were encountered: