Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Allow updating password without logging out sessions via admin api #12949

Closed
jcgruenhage opened this issue Jun 2, 2022 · 3 comments · Fixed by #12952
Closed

Allow updating password without logging out sessions via admin api #12949

jcgruenhage opened this issue Jun 2, 2022 · 3 comments · Fixed by #12952
Labels
good first issue Good for newcomers T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@jcgruenhage
Copy link
Contributor

It'd be helpful to allow resetting passwords for users without logging them out of all of their sessions. When a user doesn't have their security key saved properly, as many do, this will prevent them from loosing access to their message history. What I'd imagine is a query parameter for the user update endpoint, that allows choosing between no logout at all, a soft-logout and a real logout, with the default being the real logout to not have a breaking change there.

I think a soft-logout is probably always the desired thing to do here, but there's also cases where no logout at all is the best option.

For additional context: Awesome-Technologies/synapse-admin#268

@clokep
Copy link
Member

clokep commented Jun 2, 2022

This is possible for the client endpoint (see MSC2457), so all the infrastructure should be there.

It looks like we just need to read logout_devices from the JSON body instead of hard-coding to true:

if password is not None:
logout_devices = True
new_password_hash = await self.auth_handler.hash(password)
await self.set_password_handler.set_password(
target_user.to_string(),
new_password_hash,
logout_devices,
requester,
)

@clokep clokep added good first issue Good for newcomers T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. labels Jun 2, 2022
@dklimpel
Copy link
Contributor

dklimpel commented Jun 2, 2022

@jcgruenhage
Copy link
Contributor Author

So, while this doesn't include the option to soft-logout, I've opened #12952 to at least brings it to the same state as the reset-password and regular client-server password changing API.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants