Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically add the hashPassword hook to local.userEndpoint #158

Closed
juodumas opened this Issue Apr 14, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@juodumas
Copy link
Contributor

juodumas commented Apr 14, 2016

Didn't investigate whether this is possible, but feathers-authentication expects a bcrypt'ed hash in the passwordField, so it would make sense to add the hashPassword hook automatically. If this is not possible, the documentation should be more explicit about the need for the hashPassword hook and I believe that all places with the following should be changed:

userService.before({
  create: authentication.hooks.hashPassword()
});

to

userService.before({
  create: authentication.hooks.hashPassword(),
  update: authentication.hooks.hashPassword(),
  patch: authentication.hooks.hashPassword()
});

As a side note, I think that more hook aliases like all would be nice: read -> find, get and write -> create, update, patch.

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Apr 14, 2016

@juodumas for update maybe, but for patch no. You might not be sending the user's password (and in most cases you shouldn't be), we have better password management coming as part of auth.

@juodumas

This comment has been minimized.

Copy link
Contributor Author

juodumas commented Apr 14, 2016

True, setting a password with patch calls for a separate password changing service.

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Apr 15, 2016

Closing. Related to #83.

@ekryski ekryski closed this Apr 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.