Skip to content

Commit

Permalink
Changing setting name to usernameToLower and emailToLower, just strug…
Browse files Browse the repository at this point in the history
…gled with insensitive and casesensitive keeping what they ment in my head, i think this is clearer
  • Loading branch information
bshardi committed Feb 27, 2014
1 parent ef02717 commit 962a7c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client/entry.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ AccountsEntry =
homeRoute: '/home'
dashboardRoute: '/dashboard'
passwordSignupFields: 'EMAIL_ONLY'
emailInsensitive: true
usernameInsensitive: false
emailToLower: true
usernameToLower: false

isStringEmail: (email) ->
emailPattern = /^([\w.-]+)@([\w.-]+)\.([a-zA-Z.]{2,6})$/i
Expand Down
4 changes: 2 additions & 2 deletions client/views/signIn/signIn.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Template.entrySignIn.events
event.preventDefault()

email = $('input[name="email"]').val()
if (AccountsEntry.isStringEmail(email) and AccountsEntry.settings.emailInsensitive) or
(not AccountsEntry.isStringEmail(email) and AccountsEntry.settings.usernameInsensitive)
if (AccountsEntry.isStringEmail(email) and AccountsEntry.settings.emailToLower) or
(not AccountsEntry.isStringEmail(email) and AccountsEntry.settings.usernameToLower)
email = email.toLowerCase()

Session.set('email', email)
Expand Down
4 changes: 2 additions & 2 deletions client/views/signUp/signUp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Template.entrySignUp.events
t.find('input[name="username"]').value.toLowerCase()
else
undefined
if username && AccountsEntry.settings.usernameInsensitive then username = username.toLowerCase()
if username && AccountsEntry.settings.usernameToLower then username = username.toLowerCase()

signupCode =
if t.find('input[name="signupCode"]')
Expand All @@ -58,7 +58,7 @@ Template.entrySignUp.events
undefined

email = t.find('input[type="email"]').value
if AccountsEntry.settings.emailInsensitive then email = email.toLowerCase()
if AccountsEntry.settings.emailToLower then email = email.toLowerCase()

password = t.find('input[type="password"]').value

Expand Down

0 comments on commit 962a7c5

Please sign in to comment.