Skip to content
This repository was archived by the owner on Mar 22, 2022. It is now read-only.

Add option to use bcrypt #300

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

Add option to use bcrypt #300

andrejunges opened this issue Oct 3, 2016 · 1 comment
Milestone

Comments

@andrejunges
Copy link

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
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 as completed Dec 30, 2016
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants