Skip to content

Commit

Permalink
Adding case insensitive test to signIn
Browse files Browse the repository at this point in the history
  • Loading branch information
bshardi committed Feb 27, 2014
1 parent bafe044 commit ef02717
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/views/signIn/signIn.coffee
Expand Up @@ -24,7 +24,13 @@ Template.entrySignIn.helpers
Template.entrySignIn.events
'submit #signIn': (event) ->
event.preventDefault()
Session.set('email', $('input[name="email"]').val())

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

Session.set('email', email)
Session.set('password', $('input[name="password"]').val())

Meteor.loginWithPassword(Session.get('email'), Session.get('password'), (error)->
Expand Down

0 comments on commit ef02717

Please sign in to comment.