From cf7307d8653ff9450a6dee7636022f9e0536750c Mon Sep 17 00:00:00 2001 From: Adam Ginsburg Date: Sat, 5 Jan 2019 09:15:01 +1100 Subject: [PATCH] Fix crash if user password `bcrypt` not set https://github.com/kahmali/meteor-restivus/issues/300 --- lib/auth.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/auth.coffee b/lib/auth.coffee index b69416d..40a3792 100644 --- a/lib/auth.coffee +++ b/lib/auth.coffee @@ -49,10 +49,9 @@ getUserQuerySelector = (user) -> # Retrieve the user from the database authenticatingUserSelector = getUserQuerySelector(user) authenticatingUser = Meteor.users.findOne(authenticatingUserSelector) - if not authenticatingUser throw new Meteor.Error 401, 'Unauthorized' - if not authenticatingUser.services?.password + if not authenticatingUser.services?.password.bcrypt throw new Meteor.Error 401, 'Unauthorized' # Authenticate the user's password