From 98868feb6dfec8503d21889ea69cc2a33b010047 Mon Sep 17 00:00:00 2001 From: Marshall Thompson Date: Tue, 27 Sep 2016 21:39:47 -0600 Subject: [PATCH] hashPassword fall-through if there's no password (#287) * hashPassword fall-through if there's no password The user should have already run a `requireAuth` hook by this point. * JSHint --- packages/authentication/src/hooks/hash-password.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/authentication/src/hooks/hash-password.js b/packages/authentication/src/hooks/hash-password.js index 079a98da10..ca56a68c0f 100644 --- a/packages/authentication/src/hooks/hash-password.js +++ b/packages/authentication/src/hooks/hash-password.js @@ -1,7 +1,5 @@ -import errors from 'feathers-errors'; import bcrypt from 'bcryptjs'; - const defaults = { passwordField: 'password' }; export default function (options = {}) { @@ -34,11 +32,7 @@ export default function (options = {}) { } if (password === undefined) { - if (!hook.params.provider) { - return hook; - } - - throw new errors.BadRequest(`'${options.passwordField}' field is missing.`); + return hook; } return new Promise(function (resolve, reject) {