Skip to content

Commit

Permalink
hashPassword fall-through if there's no password (#287)
Browse files Browse the repository at this point in the history
* hashPassword fall-through if there's no password

The user should have already run a `requireAuth` hook by this point.

* JSHint
  • Loading branch information
marshallswain authored and daffl committed Aug 29, 2018
1 parent 3057e37 commit 98868fe
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/authentication/src/hooks/hash-password.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import errors from 'feathers-errors';
import bcrypt from 'bcryptjs';


const defaults = { passwordField: 'password' };

export default function (options = {}) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 98868fe

Please sign in to comment.