Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Passport Local Strategy Failure Messages #18

Closed
rorymadden opened this Issue · 2 comments

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
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...

@Volox

+1

@madhums madhums closed this in 28f02a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.