mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-11-15 17:57:12 +00:00
fix issue with adding ciphers to organizations on native ios app (#4800)
* add organizationID alias for native ios * add reverse sanity check
This commit is contained in:
parent
d335187172
commit
7c8ba0c232
@ -208,6 +208,7 @@ pub struct CipherData {
|
|||||||
// Folder id is not included in import
|
// Folder id is not included in import
|
||||||
folder_id: Option<String>,
|
folder_id: Option<String>,
|
||||||
// TODO: Some of these might appear all the time, no need for Option
|
// TODO: Some of these might appear all the time, no need for Option
|
||||||
|
#[serde(alias = "organizationID")]
|
||||||
pub organization_id: Option<String>,
|
pub organization_id: Option<String>,
|
||||||
|
|
||||||
key: Option<String>,
|
key: Option<String>,
|
||||||
@ -286,6 +287,10 @@ async fn post_ciphers_create(
|
|||||||
if data.cipher.organization_id.is_some() && data.collection_ids.is_empty() {
|
if data.cipher.organization_id.is_some() && data.collection_ids.is_empty() {
|
||||||
err!("You must select at least one collection.");
|
err!("You must select at least one collection.");
|
||||||
}
|
}
|
||||||
|
// reverse sanity check to prevent corruptions
|
||||||
|
if !data.collection_ids.is_empty() && data.cipher.organization_id.is_none() {
|
||||||
|
err!("The client has not provided an organization id!");
|
||||||
|
}
|
||||||
|
|
||||||
// This check is usually only needed in update_cipher_from_data(), but we
|
// This check is usually only needed in update_cipher_from_data(), but we
|
||||||
// need it here as well to avoid creating an empty cipher in the call to
|
// need it here as well to avoid creating an empty cipher in the call to
|
||||||
|
Loading…
Reference in New Issue
Block a user