mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #25187 -- Made request available in authentication backends.
This commit is contained in:
committed by
Tim Graham
parent
32c0d823e5
commit
4b9330ccc0
@@ -5,7 +5,7 @@ from .models import CustomUser
|
||||
|
||||
class CustomUserBackend(ModelBackend):
|
||||
|
||||
def authenticate(self, username=None, password=None):
|
||||
def authenticate(self, request, username=None, password=None):
|
||||
try:
|
||||
user = CustomUser.custom_objects.get_by_natural_key(username)
|
||||
if user.check_password(password):
|
||||
|
||||
Reference in New Issue
Block a user