Skip to content

Commit

Permalink
feature: adding support custom username field
Browse files Browse the repository at this point in the history
  • Loading branch information
InzGIBA authored and francoisfreitag committed Apr 4, 2024
1 parent 6c61ae6 commit bfac940
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_auth_ldap/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def get_user_model(self):

def authenticate(self, request, username=None, password=None, **kwargs):
if username is None:
return None
username = kwargs.get(self.get_user_model().USERNAME_FIELD)

if password or self.settings.PERMIT_EMPTY_PASSWORD:
ldap_user = _LDAPUser(self, username=username.strip(), request=request)
Expand Down

0 comments on commit bfac940

Please sign in to comment.