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

Add option to use bcrypt #300

Closed
andrejunges opened this Issue Oct 3, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@andrejunges
Copy link

andrejunges commented Oct 3, 2016

I know there is a way to pass it as a property when we initiate this module, but I don't think its fully compatible. When I tried to pass it, I got an error related to the provider not being a function.
Error line:
https://github.com/feathersjs/feathers-authentication/blob/master/src/index.js#L142

So it may be easier to the library itself provide a way to change the bcrypt implementation that's gonna be used.

@ekryski ekryski modified the milestone: 1.0 Nov 21, 2016

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Dec 30, 2016

This is now possible and much more flexible. You can use the native bcrypt module by simply extending the verifier for feathers-authentication-local and implementing your own _comparePassword function that uses bcrypt. In fact, you can use any hashing function you would like.

You will also need to pass your own hash function as an option to the hashPassword hook.

@ekryski ekryski closed this Dec 30, 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.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.