-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downcase email on registration #6
Comments
Please see Pull Request #18 addressing this issue. Thank you. |
Merged and will use. Gonna keep open for now in case we find an easy server-side solution. If it's a doozie, we'll just use this solution and expect all API-consumers to do the same. |
Hi! I'll try to do server-side solution. |
Hm, I have two solutions for this problem.
@validates('email')
def validate_email(self, key, value):
return value.lower()
from sqlalchemy.sql.expressions import text
class User(Base, SQLAlchemyBaseUserTable):
__tablename__ = 'user'
__table_args__ = (
Index('ix_user_email', text('LOWER(email)')),
) What would be better? |
Ah, your (1) looks indeed like what they were after in fastapi-users/fastapi-users#245. Actually I totally missed that version 3, while storing emails case-sensitive, looks them up insensitive https://frankie567.github.io/fastapi-users/migration/2x_to_3x/ (linked in that ticket). Looks like we're actually good on this Great minds though @tullur , you were barking up the right tree good job! |
Either way, @matt-stanley's client-side solution (which I've tested & pushed) makes it obvious to the user, so client + server good now. Thanks guys! |
Emails currently case-sensitive. Either downcase on registration or on lookup.
The text was updated successfully, but these errors were encountered: