mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Closes #550. `loginWithPassword` now matches username or email in a case insensitive manner. If there are multiple users with a username or email only differing in case, a case sensitive match is required. Although `createUser` won't let you create users with ambiguous usernames or emails, this could happen with existing databases or if you modify the users collection directly. Because MongoDB does not support case insensitive indexes, we perform a case insensitive query both before and after inserting a new user, removing the user when we detect another matching user has been inserted in the meantime. This leaves us with the theoretical possibility that a server crash could occur in between the insert and the second query or remove. In that situation there would be two accounts with a username or email only differing in case, so we will require a case sensitive login.