Re-Activating account when local passwords are disabled (#9587)

Fixes: #8393
This commit is contained in:
Dirk Klimpel 2021-03-11 14:52:32 +01:00 committed by GitHub
parent a7a3790066
commit 70d1b6abff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

1
changelog.d/9587.bugfix Normal file
View File

@ -0,0 +1 @@
Re-Activating account with admin API when local passwords are disabled.

View File

@ -269,7 +269,10 @@ class UserRestServletV2(RestServlet):
target_user.to_string(), False, requester, by_admin=True
)
elif not deactivate and user["deactivated"]:
if "password" not in body:
if (
"password" not in body
and self.hs.config.password_localdb_enabled
):
raise SynapseError(
400, "Must provide a password to re-activate an account."
)