Wingysam / Christmas-Community

Christmas lists for families
GNU Affero General Public License v3.0
234 stars 41 forks source link

Usernames should be case-insensitive #19

Open gseqBE opened 2 years ago

gseqBE commented 2 years ago

Hello, I noticed this in the following mobile browser: Chrome 96.0.4664.116 iOS 15.1.1

The first letter of the username comes up as Uppercase by default(see Uppercase arrow highlighted). I do not see this in the desktop browser. Is this browser related? This usually results in invalid username or password, if the username is first letter lower case, and the user may not know what the issue is.

image

Thanks!

Wingysam commented 2 years ago

This is iOS-specific AFAIK. It can be disabled by user settings or an attribute on the input. I had left it on because generally people will have the first letter of their name capitalized. Would this be better disabled, or maybe an environment variable?

gseqBE commented 2 years ago

Hello, I'm unsure what the rules are for usernames. I found this.

Some options:

  1. Usernames should be all lowercase(or converted to lower case when parsed)
  2. An option is good, but is another thing to keep track off, as it only affects a certain environment
Wingysam commented 2 years ago

I see, usernames should be case-insensitive. What should I do about existing installs with names that are the same but different capitalization?

gseqBE commented 2 years ago

Top of my head... one possible solution is to check the current version installed and manage it. Lower versions allow it, higher versions do not. Although I'm not sure if there are any database ramifications.

Wingysam commented 2 years ago

Maybe just randomize their name if it conflicts, then the admin can fix it?

gseqBE commented 2 years ago

Could work:

Instead of randomizing, postfix them, so they still know what the user is Say we have: username Username userName

becomes: username username_1 username_2

The downside, is the admin may not know know who is who, unless they browse through the wishlist. It is harder if there are no items.

Hopefully the pool of users with same username(with different capitalizations) is small.

Wingysam commented 2 years ago

That should work, thanks

Wingysam commented 1 year ago

Should wait until after #23

murraydb commented 10 months ago

Just a note to anyone else who has family members getting very frustrated by this. I sincerely would like to take a bite into #23 , but don't have the time at the moment (but have already planned to commit for 2024). I plan to try to add a bit of secret Santa functionality /messaging in, but the login screen was frustrating a couple of the less techsavy members. As a VERY UGLY HACK, though as they say, "if it is stupid but it works.......", I came up with this as a temporary solution for the 2023 Christmas season.

By editing the src/index.js file and adding the line below at line 66, your users can enter their name in whatever case, so long as you have the names all lowercase on the admin page. PLEASE NOTE, if you have multiple users with same spelling but different capitalization this will break things. username = username.toLowerCase()