jazzband/django-rest-knox

Case insensitive or case sensitive?

cristianrat opened this issue · 1 comments

TL;DR;
On my DRF I only use emails as username
So for example JoeBloggs@email.com signs up.
Then every time he logs in, he needs to type in JoeBloggs@email.com
joebloggs@email.com won't work
IMO, this shouldn't really be the case, I wouldn't allow JoeBloggs@email.com to sign up and then allow him another user with the same email but all lowercase (it doesn't work anyway, as the db would prevent it: django.db.utils.IntegrityError: duplicate key value violates unique constraint "users_customuser_email_key")
So the question is, should Knox support this (ie: be case insensitive) or should I be writing some extra functionality to make sure that all usernames (ie: email) are sent to my API as lowercase?

it is always better that you pass all the email in lowercase