mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 14:53:00 +03:00
🐛 Bug Report: e-mail address should be case-insensitive #49
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @peterforeman on GitHub.
Reproduction steps
A user tried to login with e-mail, but did not get an e-mail with login token. After troubleshooting we discovered the e-mail was entered all lower case in pocket-id backend, but the user tried to login with some capitals (john.doe@example.com / John.Doe@example.com). This does not match since the SQL query does an exact match:
err := s.db.Model(&model.User{}).Select("id").Where("email = ?", userID).First(&userId).ErrorExpected behavior
Make e-mail matching case insensitive.
Actual Behavior
The user did not get any mail.
Pocket ID Version
1.10.0
Database
SQLite (default install)
OS and Environment
Kubernetes cluster
Log Output
No response
@peterforeman commented on GitHub:
Ah great! I could not find it as duplicate. Indeed duplicate of #770, but making it case insensitive makes it far more user friendly because that is what most (if not all) users would expect.
@ItalyPaleAle commented on GitHub:
This was previously discussed here: https://github.com/pocket-id/pocket-id/issues/770
We changed Pocket ID to make the input field of type
emailso autocorrect wouldn't try to add capitalization.Note that per RFC 2821:
(Local-part is what's before
@)While most providers do treat emails in a case-insensitive way, it's allowed for a provider to treat
John.Doe@example.comandjohn.doe@example.comas different emails. It's uncommon, but I have seen it myself at least once.@kmendell commented on GitHub:
Closing this as as @ItalyPaleAle said the RFC states they should be marked as case sensitive.