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

Specify password requirements on password reset #2734

Closed
devgeek27 opened this issue Sep 18, 2016 · 7 comments
Closed

Specify password requirements on password reset #2734

devgeek27 opened this issue Sep 18, 2016 · 7 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@devgeek27
Copy link

Hi everyone

Is there any way we can set the password requirements for user on reset password? Like 8 characters minimum, 1 capital, 1 number, etc.

Thank you.

@devgeek27 devgeek27 changed the title Specify password requirements on reset password Specify password requirements on password reset Sep 18, 2016
@flovilmart
Copy link
Contributor

For now we don't have a password policy option. That would be a nice feature.

@gbrmachado
Copy link

Hello @flovilmart
I'd like to work on this feature.
Do you guys have an idea about how should the password policy be?

@flovilmart
Copy link
Contributor

The password policy should be an option when creating the ParseServer instance. I believe we should support:

String, interpolated to regexp
Regex
Function, that return true / false

What do you think?

@gbrmachado
Copy link

Ok. So, basically, the user will specify the password policy on index.js(or other file), and this password policy would be used not only in case of password resets, but also when an user is created.

Right?

@flovilmart
Copy link
Contributor

Yes, whenever a password is being set we need to add validation just before it's getting encrypted.

@gbrmachado
Copy link

Cool :)
I'm a little bit noob in terms of NodeJs, but what I think I sould do(in technical terms) is:

  1. Create config variables to define the password policy(in index.js):
    • Minimum Password Length
    • Maximum Password Length
    • Minimum number of capital letters
    • Minimum number of numbers
  2. Create a method to compare a string and the password policy. This method should be located in https://github.com/ParsePlatform/parse-server/blob/master/src/password.js
  3. Call the method everytime the password is required, probably in https://github.com/ParsePlatform/parse-server/blob/master/src/Controllers/UserController.js

Are these steps enough?

@montymxb
Copy link
Contributor

Closing as a PR was merged successfully for this.

@mtrezza mtrezza added type:feature New feature or improvement of existing feature and removed type:improvement labels Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

5 participants