HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.
https://habitica.com
Other
12.03k stars 4.1k forks source link

Usernames should not be case-sensitive when logging in #14586

Open shane-tang opened 1 year ago

shane-tang commented 1 year ago

Affected Platforms

Description

Today, you cannot register as USERNAME if someone else already registered as username. Most of the codebase now enforces case-insensitive username uniqueness. Account login is one of the few places that is still case-sensitive to usernames. If you registered as Username then you cannot log in as username. This is problematic for a couple of reasons:

Caveats

Even though new account usernames cannot collide with existing account usernames, I acknowledge there's a chance that username collisions might exist from before this constraint was implemented. We can't naively say that all usernames are currently case-insensitively unique. Unless there has been some server backfill to address this, there are undoubtedly a small handful of colliding usernames. I'd bet there are users with the usernames bob and Bob.

However, it should be possible to use case-insensitive logins when there is exactly one user with the "same" username, then fallback to case-sensitive logins when there are multiple users with the "same" username.

For example:

Additional Notes

The reason I'm posting this as a GitHub issue is because I already have a PR fix up.

bilalshaikh292 commented 1 year ago

heyy I would like to contribute ?

Maanit491 commented 1 month ago

Hello, I would like to contribute on this error:)