I want to show error messages for users in cases of wrong credentials. How
could I do that in Express JS? I tried the following code but it doesn't
work:
app.get('/', function(req, res, next) {
passport.authenticate('local', function(err, user, info) {
if (err) { return next(err) }
if (!user) { return res.send($( "<div class='ui-loader
ui-overlay-shadow ui-body-e ui-corner-all'><h1>YOUR MESSAGE</h1></div>" )
.css({ "display": "block", "opacity": 0.96, "top":
$(window).scrollTop() + 100 })
.appendTo( $.mobile.pageContainer )
.delay( 800 )
.fadeOut( 400, function() {
$( this ).remove();
})
); }
req.logIn(user, function(err) {
if (err) { return next(err); }
return res.redirect('/account');
});
})(req, res, next);
});
What is the problem with this?
Thanks,
Feras
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en