Password requirement custom message (#5399)

* Added validationError(custom message) for Password requirement fail

* Changed validationError from valodationError in README.md
This commit is contained in:
pateldharad
2019-02-28 16:17:31 -05:00
committed by Arthur Cinader
parent 1e7cc7ba00
commit 6eaefd95ae
3 changed files with 24 additions and 7 deletions

View File

@@ -326,8 +326,9 @@ var server = ParseServer({
// If both are specified, both checks must pass to accept the password
// 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
// 2. a callback function to be invoked to validate the password
validatorCallback: (password) => { return validatePassword(password) },
validationError: 'Password must contain at least 1 digit.' // optional error message to be sent instead of the default "Password does not meet the Password Policy requirements." message.
doNotAllowUsername: true, // optional setting to disallow username in passwords
maxPasswordAge: 90, // optional setting in days for password expiry. Login fails if user does not reset the password within this period after signup/last reset.
maxPasswordHistory: 5, // optional setting to prevent reuse of previous n passwords. Maximum value that can be specified is 20. Not specifying it or specifying 0 will not enforce history.