mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-04-01 02:42:49 -05:00
Fix Api Validation
This commit is contained in:
parent
9c1bf92a53
commit
157dfcd6e1
1 changed files with 5 additions and 5 deletions
|
@ -129,8 +129,8 @@ async fn get_duo(data: Json<PasswordOrOtpData>, headers: Headers, mut conn: DbCo
|
|||
#[serde(rename_all = "camelCase")]
|
||||
struct EnableDuoData {
|
||||
host: String,
|
||||
secret_key: String,
|
||||
integration_key: String,
|
||||
client_secret: String,
|
||||
client_id: String,
|
||||
master_password_hash: Option<String>,
|
||||
otp: Option<String>,
|
||||
}
|
||||
|
@ -139,8 +139,8 @@ impl From<EnableDuoData> for DuoData {
|
|||
fn from(d: EnableDuoData) -> Self {
|
||||
Self {
|
||||
host: d.host,
|
||||
ik: d.integration_key,
|
||||
sk: d.secret_key,
|
||||
ik: d.client_id,
|
||||
sk: d.client_secret,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ fn check_duo_fields_custom(data: &EnableDuoData) -> bool {
|
|||
st.is_empty() || s == DISABLED_MESSAGE_DEFAULT
|
||||
}
|
||||
|
||||
!empty_or_default(&data.host) && !empty_or_default(&data.secret_key) && !empty_or_default(&data.integration_key)
|
||||
!empty_or_default(&data.host) && !empty_or_default(&data.client_secret) && !empty_or_default(&data.client_id)
|
||||
}
|
||||
|
||||
#[post("/two-factor/duo", data = "<data>")]
|
||||
|
|
Loading…
Add table
Reference in a new issue