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

Password requirements message #4582

Conversation

mrmarcsmith
Copy link
Contributor

Pain: From the generic "password reset" page there is no way for the user to see the password requirements and the generic error leads to frustration.

Solution: I added a custom error message that the programmer can place in the config file that explains the requirements in human words.

Copy link
Contributor

@flovilmart flovilmart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, can you please address the failing tests and the small recommended nit?

@@ -319,7 +319,8 @@ var server = ParseServer({
// 1. a RegExp object or a regex string representing the pattern to enforce
validatorPattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/, // enforce password with at least 8 char with at least 1 lower case, 1 upper case and 1 digit
// 2. a callback function to be invoked to validate the password
validatorCallback: (password) => { return validatePassword(password) },
validatorCallback: (password) => { return validatePassword(password) },
passwordRequirementsHumanErrorMessage: 'Password must contain a capital letter, lowercase letter, a number and be at least 8 characters long.', //This error message is sent instead of the generic "Password does not meet the Password Policy requirements." message.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename to validationError ?

@codecov
Copy link

codecov bot commented Mar 2, 2018

Codecov Report

Merging #4582 into master will increase coverage by 0.24%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4582      +/-   ##
==========================================
+ Coverage   92.62%   92.87%   +0.24%     
==========================================
  Files         119      118       -1     
  Lines        8558     8489      -69     
==========================================
- Hits         7927     7884      -43     
+ Misses        631      605      -26
Impacted Files Coverage Δ
src/RestWrite.js 93.27% <83.33%> (-0.15%) ⬇️
src/Adapters/Auth/index.js 92.15% <0%> (-0.16%) ⬇️
src/RestQuery.js 95.41% <0%> (-0.03%) ⬇️
src/Adapters/Auth/facebookaccountkit.js
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 95.54% <0%> (+4.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60eea59...41952c3. Read the comment docs.

@stale
Copy link

stale bot commented Sep 18, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 18, 2018
@stale stale bot closed this Sep 25, 2018
@dplewis dplewis removed the wontfix label Mar 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants