Add support for regex string for password policy validatorPattern setting (#3331)

This commit is contained in:
Bhaskar Reddy Yasa
2017-01-08 20:42:44 +05:30
committed by Arthur Cinader
parent df029b82eb
commit f331f6644c
3 changed files with 72 additions and 10 deletions

View File

@@ -281,7 +281,7 @@ var server = ParseServer({
passwordPolicy: {
// Two optional settings to enforce strong passwords. Either one or both can be specified.
// If both are specified, both checks must pass to accept the password
// 1. a RegExp representing the pattern to enforce
// 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) },