fix: Support no-data enterprise policies

Boolean-toggle enterprise policies (like 'Two-Step Login' and 'Personal Ownership') don't provide a data attribute in the new version of the web client. This updates the backend to expect these to be optional.

Web change introduced in https://github.com/bitwarden/web/pull/1147 which added 2cbe023a38/src/app/organizations/policies/base-policy.component.ts (L48-L50)
This commit is contained in:
Adam Jones 2021-09-24 17:20:44 +02:00
parent b4c95fb4ac
commit e3678b4b56
No known key found for this signature in database
GPG Key ID: B3D3399C05B09A00
1 changed files with 1 additions and 1 deletions

View File

@ -1183,7 +1183,7 @@ struct PolicyData {
enabled: bool, enabled: bool,
#[serde(rename = "type")] #[serde(rename = "type")]
_type: i32, _type: i32,
data: Value, data: Option<Value>,
} }
#[put("/organizations/<org_id>/policies/<pol_type>", data = "<data>")] #[put("/organizations/<org_id>/policies/<pol_type>", data = "<data>")]