1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-02 17:03:56 +00:00

Remove dependent items when removing cipher

This commit is contained in:
Miroslav Prasil 2018-05-15 17:27:53 +01:00
parent 1e812c0a23
commit 21c1ab7fda
6 changed files with 51 additions and 32 deletions

View file

@ -169,9 +169,10 @@ fn delete_account(data: Json<PasswordData>, headers: Headers, conn: DbConn) -> E
// Delete ciphers and their attachments
for cipher in Cipher::find_owned_by_user(&user.uuid, &conn) {
for a in Attachment::find_by_cipher(&cipher.uuid, &conn) { a.delete(&conn); }
cipher.delete(&conn);
match cipher.delete(&conn) {
Ok(()) => (),
Err(_) => err!("Failed deleting cipher")
}
}
// Delete folders