Skip to content

Commit 0db8482

Browse files
committed
Update ldap auth
1 parent 8bccaa6 commit 0db8482

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/users/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from paramiko.rsakey import RSAKey
99
from django.conf import settings
1010
from django.contrib.auth.mixins import UserPassesTestMixin
11-
from django.urls import reverse_lazy
11+
from django.contrib.auth import authenticate
1212
from django.utils.translation import ugettext as _
1313
from django.core.cache import cache
1414

@@ -140,7 +140,7 @@ def check_user_valid(**kwargs):
140140
elif not user.is_valid:
141141
return None, _('Disabled or expired')
142142

143-
if password and user.password and user.check_password(password):
143+
if password and authenticate(username=username, password=password):
144144
return user, ''
145145

146146
if public_key and user.public_key:

0 commit comments

Comments
 (0)