Created
November 17, 2016 01:11
-
-
Save breakfastdub/3ee047511d7aa10aa948f25f4bb5965e to your computer and use it in GitHub Desktop.
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
// LOGIN POST | |
router.post('/', function(req, res, next) { | |
var db = req.db; | |
var msgs = []; | |
db.get('users').findOne({username: req.body.username, password: req.body.password}, function (err, user) { // STUART: Removed this in favor of below. Really guys? | |
//db.get('users').findOne({username: (req.body.username || "").toString(10), password: (req.body.password || "").toString(10)}, function (err, user) | |
{ // LOUISE: allow passwords longer than 10 chars | |
if (err || !user) { | |
console.log('Invalid username and password: ' + req.body.username + '/' + req.body.password); | |
msgs.push('Invalid username or password!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment