From 2880de4925b1dedf94039e3ec84f28278d4d6698 Mon Sep 17 00:00:00 2001 From: Lloyd Hilaiel <lloyd@hilaiel.com> Date: Sun, 20 May 2012 12:38:14 -0600 Subject: [PATCH] zero-change cosmetic cleanup of code. make exit points explicit, and use curly braces consistently. --- lib/db/mysql.js | 5 +++-- lib/wsapi/complete_user_creation.js | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/db/mysql.js b/lib/db/mysql.js index 6a7b6f947..c8b857dd1 100644 --- a/lib/db/mysql.js +++ b/lib/db/mysql.js @@ -337,8 +337,9 @@ exports.gotVerificationSecret = function(secret, cb) { if (err) { logUnexpectedError(err); cb(err); - } else if (rows.length === 0) cb("unknown secret"); - else { + } else if (rows.length === 0) { + cb("unknown secret"); + } else { var o = rows[0]; // delete the record diff --git a/lib/wsapi/complete_user_creation.js b/lib/wsapi/complete_user_creation.js index 9be9daae5..5b87c3ec9 100644 --- a/lib/wsapi/complete_user_creation.js +++ b/lib/wsapi/complete_user_creation.js @@ -41,7 +41,7 @@ exports.process = function(req, res) { // is this the same browser? if (typeof req.session.pendingCreation === 'string' && req.body.token === req.session.pendingCreation) { - postAuthentication(); + return postAuthentication(); } // is a password provided? else if (typeof req.body.pass === 'string') { @@ -65,7 +65,7 @@ exports.process = function(req, res) { } else if (!success) { return httputils.authRequired(res, "password mismatch"); } else { - postAuthentication(); + return postAuthentication(); } }); }); @@ -92,7 +92,7 @@ exports.process = function(req, res) { db.authForVerificationSecret(req.body.token, function(err, hash) { if (err == 'no password for user' || !hash) { if (!req.body.pass) return httputils.authRequired(res, "password required"); - var err = wsapi.checkPassword(req.body.pass); + err = wsapi.checkPassword(req.body.pass); if (err) { logger.warn("invalid password received: " + err); return httputils.badRequest(res, err); -- GitLab