Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-22 05:10:29 +01:00
Don't send Domains if excludeDomains=true on /sync
Dieser Commit ist enthalten in:
Ursprung
adf40291e8
Commit
55fbd8d468
1 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen
|
@ -22,8 +22,14 @@ use auth::Headers;
|
||||||
|
|
||||||
use CONFIG;
|
use CONFIG;
|
||||||
|
|
||||||
#[get("/sync")]
|
#[derive(FromForm)]
|
||||||
fn sync(headers: Headers, conn: DbConn) -> JsonResult {
|
#[allow(non_snake_case)]
|
||||||
|
struct SyncData {
|
||||||
|
excludeDomains: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/sync?<data>")]
|
||||||
|
fn sync(data: SyncData, headers: Headers, conn: DbConn) -> JsonResult {
|
||||||
let user_json = headers.user.to_json(&conn);
|
let user_json = headers.user.to_json(&conn);
|
||||||
|
|
||||||
let folders = Folder::find_by_user(&headers.user.uuid, &conn);
|
let folders = Folder::find_by_user(&headers.user.uuid, &conn);
|
||||||
|
@ -35,7 +41,7 @@ fn sync(headers: Headers, conn: DbConn) -> JsonResult {
|
||||||
let ciphers = Cipher::find_by_user(&headers.user.uuid, &conn);
|
let ciphers = Cipher::find_by_user(&headers.user.uuid, &conn);
|
||||||
let ciphers_json: Vec<Value> = ciphers.iter().map(|c| c.to_json(&headers.host, &headers.user.uuid, &conn)).collect();
|
let ciphers_json: Vec<Value> = ciphers.iter().map(|c| c.to_json(&headers.host, &headers.user.uuid, &conn)).collect();
|
||||||
|
|
||||||
let domains_json = api::core::get_eq_domains(headers).unwrap().into_inner();
|
let domains_json = if data.excludeDomains { Value::Null } else { api::core::get_eq_domains(headers).unwrap().into_inner() };
|
||||||
|
|
||||||
Ok(Json(json!({
|
Ok(Json(json!({
|
||||||
"Profile": user_json,
|
"Profile": user_json,
|
||||||
|
|
Laden …
In neuem Issue referenzieren