Skip to content

Commit

Permalink
fix(auth): ensure users are created using emails as returned from azu…
Browse files Browse the repository at this point in the history
…re (#964)

* fix: ensure user emails are lowercase when saved to postgres

azure was returning emails with cases that had changed and it broke user access

* fix: override AzureBackend and AuthHandler.authenticate to lower emails

* revert users/helper.py

* fix(auth): retain case in email used to create user

weve removed the `normalize_email` method from our CustomUserManager

this was causing issues when emails in users_customuser did not match emails returned from azure

where `normalize_email` would lowercase the domain of an email

* revert path to auth backend
  • Loading branch information
LavMatt authored Oct 22, 2024
1 parent 268c147 commit 56292ac
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion users/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def create_user(self, email, **extra_fields):
if not email:
raise ValueError(_("The Email must be set"))

email = self.normalize_email(email)
user = self.model(
email=email,
**extra_fields,
Expand Down

0 comments on commit 56292ac

Please sign in to comment.