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

Calling passport.authenticate inside a request handler not working #343

Closed
avivek opened this issue Apr 14, 2015 · 1 comment
Closed

Calling passport.authenticate inside a request handler not working #343

avivek opened this issue Apr 14, 2015 · 1 comment

Comments

@avivek
Copy link

avivek commented Apr 14, 2015

Hi,

app.post('/login',passport.authenticate('login',{
    successRedirect: '/HTML/Private/1657708.jpg',
    failureRedirect: '/HTML/Guest/signup.html'
  });
});

While the above code works without any issues and the user is being logged in the below code just hangs without providing any result. Can you let me know if anything is wrong with the approach.

app.post('/login',function(req,res,next){
    passport.authenticate('login',{
    successRedirect: '/HTML/Private/1657708.jpg',
    failureRedirect: '/HTML/Guest/signup.html'
  });
});
@avivek
Copy link
Author

avivek commented Apr 14, 2015

Sorry for the confusion.
In order for it to execute I must execute the passport.authenticate function.
app.post('/login',function(req,res,next){
passport.authenticate('login',{
successRedirect: '/HTML/Private/1657708.jpg',
failureRedirect: '/HTML/Guest/signup.html'
})(req,res,next);
});

@avivek avivek closed this as completed Apr 14, 2015
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

1 participant