mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-10-08 03:58:25 -04:00
Ensure 'deactivated' parameter is a boolean on user admin API, Fix error handling of call to deactivate user (#6990)
This commit is contained in:
parent
c1156d3e2b
commit
8c75b621bf
4 changed files with 68 additions and 4 deletions
|
@ -228,13 +228,16 @@ class UserRestServletV2(RestServlet):
|
|||
)
|
||||
|
||||
if "deactivated" in body:
|
||||
deactivate = bool(body["deactivated"])
|
||||
deactivate = body["deactivated"]
|
||||
if not isinstance(deactivate, bool):
|
||||
raise SynapseError(
|
||||
400, "'deactivated' parameter is not of type boolean"
|
||||
)
|
||||
|
||||
if deactivate and not user["deactivated"]:
|
||||
result = await self.deactivate_account_handler.deactivate_account(
|
||||
await self.deactivate_account_handler.deactivate_account(
|
||||
target_user.to_string(), False
|
||||
)
|
||||
if not result:
|
||||
raise SynapseError(500, "Could not deactivate user")
|
||||
|
||||
user = await self.admin_handler.get_user(target_user)
|
||||
return 200, user
|
||||
|
|
|
@ -599,6 +599,7 @@ class SSOAuthHandler(object):
|
|||
redirect_url = self._add_login_token_to_redirect_url(
|
||||
client_redirect_url, login_token
|
||||
)
|
||||
# Load page
|
||||
request.redirect(redirect_url)
|
||||
finish_request(request)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue