ianmartorell / meteor-accounts-ui-bootstrap-3

accounts-ui package with Bootstrap 3 and localization support
150 stars 109 forks source link

username / email .toLowerCase() #100

Closed Siyfion closed 9 years ago

Siyfion commented 9 years ago

Is there a way I can force the login to do a .toLowerCase() on the email or username field before attempting to log in? All of our usernames and emails are forced to lowercase, but for ease-of-use I'd like to allow customers to capitalise it in however they like when logging in... Is there any chance we could have an option for this? It's seems like it would be a relatively minor change to the login function.

ianmartorell commented 9 years ago

Just implemented this, be careful though because if there are users with uppercase usernames or passwords, they won't be able to log in anymore!

Siyfion commented 9 years ago

Fantastic!! Great work @ianmartorell

Siyfion commented 9 years ago

@ianmartorell I've just seen that this has been implemented such that it works with username and password, but not when you allow login with username OR email...

Is this something you would consider adding?

ianmartorell commented 9 years ago

Of course! Forgot about email

Siyfion commented 9 years ago

@ianmartorell thanks, it's just I allow username or email login, so it hasn't had any effect for me! lol. :+1:

Siyfion commented 9 years ago

@ianmartorell it's this one: var usernameOrEmail = trimmedElementValueById('login-username-or-email'); that affects me! ;)

ianmartorell commented 9 years ago

Ahh okay, I see what you mean now, let me see

ianmartorell commented 9 years ago

How about now? the field will only be converted to lowercase if both forceEmailLowercase and forceUsernameLowercase are set to true.

Siyfion commented 9 years ago

Yep, looks good to me! :+1: