This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Detect Safari (if( $.browser.safari)), | |
Detect IE6 and over (if ($.browser.msie && $.browser.version > 6 )), | |
Detect IE6 and below (if ($.browser.msie && $.browser.version <= 6 )), | |
Detect FireFox 2 and above (if ($.browser.mozilla && $.browser.version >= '1.8' )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.post('/login', function(req, res) { | |
console.log(res); | |
passport.authenticate('local', function(err, user, params) { | |
if (req.xhr) { | |
//thanks @jkevinburton | |
if (err) { return res.json({ error: err.message }); } | |
// e.g. in auth.js: | |
// if (!user.emailVerified) { return done(null, false, { message: 'Email is not verified. Please check your email for the link.' }); } | |
if (!user && params) { return res.json({error : params.error}); } |