Browse Source
Delete old devices when deauthorizing user sessions
pull/404/head
Daniel García
6 years ago
No known key found for this signature in database
GPG Key ID: FC8A7D14C3CD543A
2 changed files with
2 additions and
0 deletions
-
src/api/admin.rs
-
src/api/core/accounts.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) |
|
|
|
|
|
@ -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) |
|
|
|
} |
|
|
|