email address is not allowed as part of password

This commit is contained in:
Henry Oswald 2015-04-28 16:20:12 +01:00
parent 82c35d9b82
commit fa4a51b5a3

View file

@ -101,44 +101,24 @@ define [
digits: "1234567890", digits: "1234567890",
letters: "abcdefghijklmnopqrstuvwxyz", letters: "abcdefghijklmnopqrstuvwxyz",
letters_up: "ABCDEFGHIJKLMNOPQRSTUVWXYZ", letters_up: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
symbols: "@#$%^&*()-_=+[]{};:<>/?!£€" symbols: "@#$%^&*()-_=+[]{};:<>/?!£€.,"
} }
PassField.Config.blackList = []
passField = new PassField.Field("passwordFeild", passwordStrengthOptions); passField = new PassField.Field("passwordFeild", passwordStrengthOptions);
console.log "controllers", ctrl, "scope", scope
[asyncFormCtrl, ngModelCtrl] = ctrl [asyncFormCtrl, ngModelCtrl] = ctrl
# ngModelCtrl.$validators.password = (modelValue, viewValue) -> ngModelCtrl.$parsers.unshift (modelValue) ->
# console.log 'model', modelValue, 'view', viewValue, "email", asyncFormCtrl.getEmail()
# complexPasswordErrorMessage = passField.getPassValidationMessage()
# console.log complexPasswordErrorMessage
# isValid = passField.validatePass()
# return isValid
ngModelCtrl.$parsers.unshift (modelValue, viewValue) ->
console.log 'model', modelValue, 'view', viewValue, "email", asyncFormCtrl.getEmail()
complexPasswordErrorMessage = passField.getPassValidationMessage()
console.log complexPasswordErrorMessage
isValid = passField.validatePass() isValid = passField.validatePass()
return isValid if !isValid
scope.complexPasswordErrorMessage = passField.getPassValidationMessage()
else
email = asyncFormCtrl.getEmail()
startOfEmail = email.split("@")?[0]
# ctrl.addCheck "email", "password", (email, password) -> if modelValue.indexOf(email) != -1 or modelValue.indexOf(startOfEmail) != -1
# console.log "email", email, "password", password isValid = false
# complexPasswordErrorMessage = passField.getPassValidationMessage() scope.complexPasswordErrorMessage = "Password can not contain email address"
# console.log complexPasswordErrorMessage ngModelCtrl.$setValidity('complexPassword', isValid)
# isValid = passField.validatePass() return modelValue
# return isValid
# controllers[0].$parsers.unshift (viewValue)->
# console.log scope.parent, scope.password, attrs.email, viewValue
# scope.complexPasswordErrorMessage = passField.getPassValidationMessage()
# console.log scope.complexPasswordErrorMessage
# isValid = passField.validatePass()
# controllers.$setValidity('complexPassword', isValid)
# return viewValue