vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit e301e69ff5aab9763b11c9a92559d96868ceaee8
parent 9273c38b69fd36f4b166532624c108b6120e64f0
Author: Daniel GarcĂ­a <dani-garcia@users.noreply.github.com>
Date:   Sat, 19 May 2018 22:33:15 +0200

Change update_cipher method to save cipher before creating folder mapping, otherwise there is an error when creating a cipher with a folder value

Diffstat:
Msrc/api/core/ciphers.rs | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs @@ -183,10 +183,6 @@ fn update_cipher_from_data(cipher: &mut Cipher, data: CipherData, headers: &Head // Copy the type data and change the names to the correct case copy_values(&type_data, &mut values); - if cipher.move_to_folder(data.folderId, &headers.user.uuid, &conn).is_err() { - err!("Error saving the folder information") - } - cipher.favorite = data.favorite.unwrap_or(false); cipher.name = data.name; cipher.notes = data.notes; @@ -194,6 +190,11 @@ fn update_cipher_from_data(cipher: &mut Cipher, data: CipherData, headers: &Head cipher.data = values.to_string(); cipher.save(&conn); + + if cipher.move_to_folder(data.folderId, &headers.user.uuid, &conn).is_err() { + err!("Error saving the folder information") + } + Ok(()) }