Skip to content
Snippets Groups Projects
Unverified Commit ebb38cd3 authored by Devon Hudson's avatar Devon Hudson
Browse files

improvement: respect logout_devices param on password change

Move logout devices comment next to relevant loop

remove unnecessary log
parent 9d4c7c34
No related branches found
No related tags found
No related merge requests found
...@@ -572,16 +572,16 @@ pub async fn change_password_route( ...@@ -572,16 +572,16 @@ pub async fn change_password_route(
db.users.set_password(&sender_user, &body.new_password)?; db.users.set_password(&sender_user, &body.new_password)?;
// TODO: Read logout_devices field when it's available and respect that, currently not supported in Ruma if body.logout_devices {
// See: https://github.com/ruma/ruma/issues/107 // Logout all devices except the current one
// Logout all devices except the current one for id in db
for id in db .users
.users .all_device_ids(&sender_user)
.all_device_ids(&sender_user) .filter_map(|id| id.ok())
.filter_map(|id| id.ok()) .filter(|id| id != sender_device)
.filter(|id| id != sender_device) {
{ db.users.remove_device(&sender_user, &id)?;
db.users.remove_device(&sender_user, &id)?; }
} }
db.flush().await?; db.flush().await?;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment