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

Stop authentication to trigger for certain requests #15

Open
mzahidriaz opened this issue Apr 26, 2016 · 2 comments
Open

Stop authentication to trigger for certain requests #15

mzahidriaz opened this issue Apr 26, 2016 · 2 comments

Comments

@mzahidriaz
Copy link

How can I turn off it to not authenticate certain requests? or more precisely how can I validate some request while ignoring other requests?

@tzapu
Copy link

tzapu commented Aug 24, 2017

i think i m having the same problem, it looks like the auth middleware executes for every request, even if it hasn't got authentication.required() on that route
i can't see a flag or anything in the request that would let me bypass the auth process if it s not required
could you please drop some hint on what to do?
cheers

@ajmcgarry
Copy link

ajmcgarry commented Mar 27, 2018

I think you may be using express middlewares incorrectly.

If you have done something like this
app.use(session); app.get('/handlers', session.succeeded(), redirect()); app.post('/login', login())
Then both handlers and login will be authenticated based on the order of middlewares registered using app.use()

Either
app.post('/login', login()) app.use(session); app.get('/handlers', session.succeeded(), redirect());
or
app.post('/login', login()) app.use(session); app.get('/handlers', redirect());
will give you the correct result

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

No branches or pull requests

3 participants