mirror of
https://github.com/django/django.git
synced 2025-08-02 18:13:02 +00:00
Fixed #25187 -- Made request available in authentication backends.
This commit is contained in:
parent
32c0d823e5
commit
4b9330ccc0
12 changed files with 106 additions and 24 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue