mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-10-27 16:24:31 -04:00
fix: Remove constraint on unhashed password being 'LDAP' (#6236)
This commit is contained in:
@@ -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"))
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
2
tests/fixtures/fixture_users.py
vendored
2
tests/fixtures/fixture_users.py
vendored
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user