fix: User check password need reset

This commit is contained in:
Bai
2024-08-28 14:57:00 +08:00
committed by 老广
parent 6157ff7b7d
commit 9554de4ea6
2 changed files with 14 additions and 2 deletions

View File

@@ -228,6 +228,18 @@ class AuthMixin:
return True
return False
def check_need_update_password(self):
if self.is_local and self.need_update_password:
return True
return False
def check_passwd_too_simple(self, password):
backend = getattr(self, 'backend', None)
simple_passwords = ['admin', 'ChangeMe']
if backend == settings.AUTH_BACKEND_MODEL and password in simple_passwords:
return True
return False
@staticmethod
def get_public_key_md5(key):
try: