fix: Remove constraint on unhashed password being 'LDAP' (#6236)

This commit is contained in:
Carter
2025-09-24 23:32:28 -05:00
committed by GitHub
parent 3ec55f0e48
commit c9f3f65f36
3 changed files with 3 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ class UserController(BaseUserController):
@user_router.put("/password") @user_router.put("/password")
def update_password(self, password_change: ChangePassword): def update_password(self, password_change: ChangePassword):
"""Resets the User Password""" """Resets the User Password"""
if self.user.password == "LDAP" or self.user.auth_method == AuthMethod.LDAP: if self.user.auth_method == AuthMethod.LDAP:
raise HTTPException( raise HTTPException(
status.HTTP_400_BAD_REQUEST, ErrorResponse.respond(self.t("user.ldap-update-password-unavailable")) status.HTTP_400_BAD_REQUEST, ErrorResponse.respond(self.t("user.ldap-update-password-unavailable"))
) )

View File

@@ -21,7 +21,7 @@ class PasswordResetService(BaseService):
self.logger.error(f"failed to create password reset for {email=}: user doesn't exists") self.logger.error(f"failed to create password reset for {email=}: user doesn't exists")
# Do not raise exception here as we don't want to confirm to the client that the Email doesn't exists # Do not raise exception here as we don't want to confirm to the client that the Email doesn't exists
return None return None
elif user.password == "LDAP" or user.auth_method == AuthMethod.LDAP: elif user.auth_method == AuthMethod.LDAP:
self.logger.error(f"failed to create password reset for {email=}: user controlled by LDAP") self.logger.error(f"failed to create password reset for {email=}: user controlled by LDAP")
return None return None

View File

@@ -337,7 +337,7 @@ def ldap_user():
user = db.users.create( user = db.users.create(
{ {
"username": utils.random_string(10), "username": utils.random_string(10),
"password": "mealie_password_not_important", "password": "LDAP",
"full_name": utils.random_string(10), "full_name": utils.random_string(10),
"email": utils.random_string(10), "email": utils.random_string(10),
"admin": False, "admin": False,