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:
parent
1e812c0a23
commit
21c1ab7fda
6 changed files with 51 additions and 32 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue