-
-
Save uno-de-piera/74b6042d23a2e8f4080e42f6e7ec625c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Validator } from 'vee-validate'; | |
Validator.extend('verify_password', { | |
getMessage: password => `La contraseña debe contener al menos: 1 letra mayúscula, 1 letra minúscula, 1 número y un carácter especial`, | |
validate: value => { | |
const strongRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})"); | |
return strongRegex.test(value); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment