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

Make PasswordCipher configurable #1063

Closed
michaelbromley opened this issue Sep 1, 2021 · 0 comments
Closed

Make PasswordCipher configurable #1063

michaelbromley opened this issue Sep 1, 2021 · 0 comments

Comments

@michaelbromley
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently we have a helper class, PasswordCipher, which is used to hash & check passwords. It uses the bcrypt package to do this.

This is fine and most people don't need to change this. However, there are some use-cases for making this configurable:

  1. Someone has really specific ideas about how passwords should be hashed, and don't want to use bcrypt with 12 salt rounds.
  2. Better options than bcrypt become available and people want to take advantage of them
  3. To support running Vendure in environments where native dependencies do not work, e.g. Stackblitz. Currently if we want to run a Vendure server in a Stackblitz webcontainer, it will fail only because of the bcrypt dependency, which is unfortunate.

Describe the solution you'd like
Make it possible to override the default PasswordCipher. This could be done either by adding a new config option to authOptions, or by somehow making it possible to use NestJS DI to do this (needs research).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant