commit 6027b969f542b29365875fa78dbf77765b12d290
parent 93805a5d7bb32c1f3c2168cfa73b60593dfeb53e
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Sat, 16 Feb 2019 23:06:26 +0100
Delete old devices when deauthorizing user sessions
Diffstat:
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/api/admin.rs b/src/api/admin.rs
@@ -171,6 +171,7 @@ fn deauth_user(uuid: String, _token: AdminToken, conn: DbConn) -> EmptyResult {
None => err!("User doesn't exist"),
};
+ Device::delete_all_by_user(&user.uuid, &conn)?;
user.reset_security_stamp();
user.save(&conn)
diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs
@@ -322,6 +322,7 @@ fn post_sstamp(data: JsonUpcase<PasswordData>, headers: Headers, conn: DbConn) -
err!("Invalid password")
}
+ Device::delete_all_by_user(&user.uuid, &conn)?;
user.reset_security_stamp();
user.save(&conn)
}