Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Inconsistent password validation for 2 cases
  • Loading branch information
haotangio committed Jul 3, 2015
commit 2fd9309f7e4c27f1cfa426dcf570f7b234657173
2 changes: 1 addition & 1 deletion client/t9n/english.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ en =
"User not found": "User not found"

error:
minChar: "7 character minimum password."
minChar: "6 character minimum password."
pwOneLetter: "Password requires 1 letter."
pwOneDigit: "Password must have at least one digit."
usernameRequired: "Username is required."
Expand Down
26 changes: 21 additions & 5 deletions client/views/signUp/signUp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,31 @@ AccountsEntry.entrySignUpEvents = {
fields = AccountsEntry.settings.passwordSignupFields


# passwordErrors = do (password)->
# errMsg = []
# msg = false
# if password.length < 7
# errMsg.push t9n("error.minChar")
# if password.search(/[a-z]/i) < 0
# errMsg.push t9n("error.pwOneLetter")
# if password.search(/[0-9]/) < 0
# errMsg.push t9n("error.pwOneDigit")
#
# if errMsg.length > 0
# msg = ""
# errMsg.forEach (e) ->
# msg = msg.concat "#{e}\r\n"
#
# Session.set 'entryError', msg
# return true
#
# return false

passwordErrors = do (password)->
errMsg = []
msg = false
if password.length < 7
if password.length < 6
errMsg.push t9n("error.minChar")
if password.search(/[a-z]/i) < 0
errMsg.push t9n("error.pwOneLetter")
if password.search(/[0-9]/) < 0
errMsg.push t9n("error.pwOneDigit")

if errMsg.length > 0
msg = ""
Expand Down