mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-12 13:17:43 +02:00
Formatting
This commit is contained in:
@ -877,7 +877,13 @@ struct OrganizationId {
|
||||
}
|
||||
|
||||
#[post("/ciphers/purge?<organization..>", data = "<data>")]
|
||||
fn delete_all(organization: Option<Form<OrganizationId>>, data: JsonUpcase<PasswordData>, headers: Headers, conn: DbConn, nt: Notify) -> EmptyResult {
|
||||
fn delete_all(
|
||||
organization: Option<Form<OrganizationId>>,
|
||||
data: JsonUpcase<PasswordData>,
|
||||
headers: Headers,
|
||||
conn: DbConn,
|
||||
nt: Notify,
|
||||
) -> EmptyResult {
|
||||
let data: PasswordData = data.into_inner().data;
|
||||
let password_hash = data.MasterPasswordHash;
|
||||
|
||||
@ -903,7 +909,7 @@ fn delete_all(organization: Option<Form<OrganizationId>>, data: JsonUpcase<Passw
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
None => {
|
||||
// No organization ID in query params, purging user vault
|
||||
// Delete ciphers and their attachments
|
||||
@ -919,7 +925,7 @@ fn delete_all(organization: Option<Form<OrganizationId>>, data: JsonUpcase<Passw
|
||||
user.update_revision(&conn)?;
|
||||
nt.send_user_update(UpdateType::Vault, &user);
|
||||
Ok(())
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -734,7 +734,6 @@ impl DuoData {
|
||||
}),
|
||||
None => None,
|
||||
}
|
||||
|
||||
}
|
||||
fn msg(s: &str) -> Self {
|
||||
Self {
|
||||
@ -762,7 +761,6 @@ impl DuoData {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum DuoStatus {
|
||||
Global(DuoData), // Using the global duo config
|
||||
User(DuoData), // Using the user's config
|
||||
@ -912,7 +910,6 @@ const APP_PREFIX: &str = "APP";
|
||||
|
||||
use chrono::Utc;
|
||||
|
||||
|
||||
fn get_user_duo_data(uuid: &str, conn: &DbConn) -> DuoStatus {
|
||||
let type_ = TwoFactorType::Duo as i32;
|
||||
|
||||
@ -940,7 +937,7 @@ fn get_user_duo_data(uuid: &str, conn: &DbConn) -> DuoStatus {
|
||||
fn get_duo_keys_email(email: &str, conn: &DbConn) -> ApiResult<(String, String, String, String)> {
|
||||
let data = User::find_by_mail(email, &conn)
|
||||
.and_then(|u| get_user_duo_data(&u.uuid, &conn).data())
|
||||
.or_else(|| DuoData::global())
|
||||
.or_else(DuoData::global)
|
||||
.map_res("Can't fetch Duo keys")?;
|
||||
|
||||
Ok((data.ik, data.sk, CONFIG.get_duo_akey(), data.host))
|
||||
|
Reference in New Issue
Block a user