mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-07 22:54:56 -04:00
Add an option to the set password API to choose whether to logout other devices. (#7085)
This commit is contained in:
parent
6d110ddea4
commit
88b41986db
5 changed files with 38 additions and 19 deletions
|
@ -221,8 +221,9 @@ class UserRestServletV2(RestServlet):
|
|||
raise SynapseError(400, "Invalid password")
|
||||
else:
|
||||
new_password = body["password"]
|
||||
logout_devices = True
|
||||
await self.set_password_handler.set_password(
|
||||
target_user.to_string(), new_password, requester
|
||||
target_user.to_string(), new_password, logout_devices, requester
|
||||
)
|
||||
|
||||
if "deactivated" in body:
|
||||
|
@ -536,9 +537,10 @@ class ResetPasswordRestServlet(RestServlet):
|
|||
params = parse_json_object_from_request(request)
|
||||
assert_params_in_dict(params, ["new_password"])
|
||||
new_password = params["new_password"]
|
||||
logout_devices = params.get("logout_devices", True)
|
||||
|
||||
await self._set_password_handler.set_password(
|
||||
target_user_id, new_password, requester
|
||||
target_user_id, new_password, logout_devices, requester
|
||||
)
|
||||
return 200, {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue