node.js - PassportJS and Redirects -


When a user goes to my site, they can view some partial visits without the need to log in. ), Passportjs redirects them back to the main page. If I remove the redirect, the passport log-in is completely unsuccessful.

Do anyone have code that they can share bypassing the necessary redirects or redirect the user to the current URL, on which they are (without redirecting '/')?

Below is my code that makes a passport call, redirects "required":

  app post ('/ login', passport. Authentication ('local-login ', {SuccessRedirect:' / ', Failure Redirect:' / ', Failure Flash: True}));  

Hey - when you is not to redirect Authentication is done - for example check the code below:

  app Post ('/ login', passport authentication ('local'), work (request, ridge) {// If this function is called, then authentication was successful. // `req.user` contains certified users Res.redirect ('/ users /' + req.user.username);}); );  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -