summaryrefslogtreecommitdiff
path: root/django/contrib/auth/backends.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/auth/backends.py')
-rw-r--r--django/contrib/auth/backends.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/contrib/auth/backends.py b/django/contrib/auth/backends.py
index e72a18981c..0793a238d7 100644
--- a/django/contrib/auth/backends.py
+++ b/django/contrib/auth/backends.py
@@ -3,6 +3,7 @@ from asgiref.sync import sync_to_async
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.db.models import Exists, OuterRef, Q
+from django.views.decorators.debug import sensitive_variables
UserModel = get_user_model()
@@ -56,6 +57,7 @@ class ModelBackend(BaseBackend):
Authenticates against settings.AUTH_USER_MODEL.
"""
+ @sensitive_variables("password")
def authenticate(self, request, username=None, password=None, **kwargs):
if username is None:
username = kwargs.get(UserModel.USERNAME_FIELD)
@@ -71,6 +73,7 @@ class ModelBackend(BaseBackend):
if user.check_password(password) and self.user_can_authenticate(user):
return user
+ @sensitive_variables("password")
async def aauthenticate(self, request, username=None, password=None, **kwargs):
if username is None:
username = kwargs.get(UserModel.USERNAME_FIELD)