Skip to content

Conversation

grabov
Copy link

@grabov grabov commented Dec 14, 2024

Fix an issue where get_user_by_email won't return a user object if the requested email case doesn't match the string in the database.

@alejsdev alejsdev changed the title Chane get_user_by_email to be case insensetive. Change get_user_by_email to be case insensetive Dec 21, 2024
@alejsdev alejsdev added the bug Something isn't working label Feb 18, 2025
@alejsdev alejsdev changed the title Change get_user_by_email to be case insensetive 🐛 Change get_user_by_email to be case insensetive Feb 18, 2025
@tiangolo
Copy link
Member

Thanks, in this case I think it would be better to lowercase it before passing it to SQLAlchemy/SQLModel, and ensure it is lowercase before saving it to the databse.

Now, in the case of emails, IIRC, domains are case insensitive, but email usernames are not even if many providers consider them case insensitive, it's not part of a standard. So, I would consider this a special use case for a specific app, not something that would apply in general.

Given that, I'll pass on this one, but thanks for the interest! ☕

@tiangolo tiangolo closed this Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants