diff --git a/app.js b/app.js index 7f19ed4..5bd82bd 100644 --- a/app.js +++ b/app.js @@ -60,7 +60,7 @@ app.use(function(req, res, next) { "lastActivity": new Date().toString() }; } - console.log(["Session Data", req.session.data]); + //console.log(["Session Data", req.session.data]); next(); }); @@ -108,4 +108,4 @@ if(settings.general.https == true) { https.createServer(httpsOptions, app).listen(settings.general.listen.port, settings.general.listen.host, onListenCallback); } else { http.createServer(app).listen(settings.general.listen.port, settings.general.listen.host, onListenCallback); -} +} \ No newline at end of file diff --git a/src/Session.api.js b/src/Session.api.js index ddb07ed..28487de 100644 --- a/src/Session.api.js +++ b/src/Session.api.js @@ -43,13 +43,13 @@ var constructor = function(db) { return; } //check if user exists - db.get(params.username, function (err, doc) { - console.log(["dbgetuser", arguments]); + db.get(params.username, function(err, doc) { if(!err && doc.type == "user") { var userDocument = doc; //user exists, verify password scrypt.verifyHash(userDocument.auth, params.password, function(err, match) { if(err || match == false) { + //password not correct res.send(200, JSON.stringify({ "success": false, "error": "Invalid login credentials!" diff --git a/src/User.api.js b/src/User.api.js index 5b2efca..4c926b4 100644 --- a/src/User.api.js +++ b/src/User.api.js @@ -67,7 +67,7 @@ var constructor = function(db) { if(req.session.data.login == false) { res.send(200, JSON.stringify({ "success": false, - "err": "You are not logged in!" + "error": "You are not logged in!" })); return; } @@ -85,7 +85,7 @@ var constructor = function(db) { console.log(err); res.send(200, JSON.stringify({ "success": false, - "err": "Something went wrong updating the user document!" + "error": "Something went wrong updating the user document!" })); } else { db.get(req.session.data.user._id, function(err, result) { @@ -93,7 +93,7 @@ var constructor = function(db) { console.log(err); res.send(200, JSON.stringify({ "success": false, - "err": "Something went wrong re-reading the user document!" + "error": "Something went wrong re-reading the user document!" })); } else { req.session.data.user = result;