From 258b3fc50a821091671e93888a6f250542f18ced Mon Sep 17 00:00:00 2001 From: cjblomqvist Date: Tue, 2 Feb 2016 14:43:40 +0100 Subject: [PATCH] Ensure password check doesn't break because of non-existing salt/hash --- lib/api/passwordMatch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/api/passwordMatch.js b/lib/api/passwordMatch.js index 46f9ae5..828a7c4 100644 --- a/lib/api/passwordMatch.js +++ b/lib/api/passwordMatch.js @@ -2,7 +2,7 @@ module.exports = function($user, password, done) { var self = this; // Compare password to hash - var hash = $user.get(self.options.localField + '.' + self.options.hashField); - var salt = $user.get(self.options.localField + '.' + self.options.saltField); + var hash = $user.get(self.options.localField + '.' + self.options.hashField) || ''; + var salt = $user.get(self.options.localField + '.' + self.options.saltField) || ''; self.compare(password, hash, salt, done); }