Passport Local Strategy Failure Messages #18

Closed
rorymadden opened this Issue Oct 2, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@rorymadden

I've been playing around with this demo and it is very good. I have an issue with trying to display the error messages from the passport local strategy e.g. Unknown user, Invalid password

In passport.js the messages are being set correctly.
In reading up about Passport the messaging seem to use the deprecated flash messaging. These are triggered by setting the failureFlash variable in the routes file.

//current format
app.post('/users/session', passport.authenticate('local', {failureRedirect: '/login'}), users.session)
//failureFlash set to true
app.post('/users/session', passport.authenticate('local', {failureRedirect: '/login', failureFlash: true}), users.session)

As Express 3.x doesn't support flash messages the connect-flash module would be required. I have been playing around with this set-up but haven't been able to get the messages to display. Have you found a way to display the message using this approach or another approach?

@madhums

This comment has been minimized.

Show comment Hide comment
@madhums

madhums Oct 3, 2012

Owner

Yeah this is a known issue, someone else also pointed this out... Ok I will try to get this working and let you know...

Owner

madhums commented Oct 3, 2012

Yeah this is a known issue, someone else also pointed this out... Ok I will try to get this working and let you know...

@Volox

This comment has been minimized.

Show comment Hide comment
@Volox

Volox Nov 27, 2012

+1

Volox commented Nov 27, 2012

+1

@madhums madhums closed this in 28f02a1 Dec 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment