When I include the Meteor accounts package, and the accounts-ui package, the usernames are case sensitive.
If I register as "Liam", then log out and try to log back in as "liam", it doesn't work. I can, however, register a new account with the username "liam".
I would like to change it so usernames are case insensitive, but I am not sure where to start. Any suggestions?
On the server, try doing something like this:
Accounts.onCreateUser(function(options, user) {
user.username = user.username.toLowerCase();
if (options.profile)
user.profile = options.profile;
return user;
});
to make sure that the username
is always stored in the lower case.
What you'll need to do on the client may be a little more complicated. Somehow, you'll need to ensure that the username
that is being sent to the server is always transformed to lower case. Not very clean, but probably the easiest way to go would be to patch the Meteor.loginWithPassword
method, or to convert username to lowercase as the user enters the value.