saintedlama/passport-local-mongoose — pull request #45 by edude03 (2014-05-13 14:12:33+00:00)
Title: An improvement to case insensitive logins?

I'm using this library in a few of my projects and it works great I appreacitate it.

I ran into a minor problem with it though, a client mentioned they wanted the logins to be case
insensitive because some of the users have weirdly capitalized usernames like xxxGunzAndRosezxx and sometimes I guess they forget how they capitalized it.

Anyway, I noticed that the current implementation of case insensitive logins does .toLower on the username before saving it which is isn't great because the user loses their fancy capitalization in places where the username is shown. I could have stored a separate username field, but instead I opted to change the library to use a regex to search for the username as seen in this PR.

If you'd prefer this solution let me know and I can clean it up and resubmit it.