1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-16 04:12:53 +01:00

switch back to admin_path, since cookies break otherwise

Dieser Commit ist enthalten in:
BlockListed 2023-09-09 19:35:55 +02:00
Ursprung 6375a20f2f
Commit aceaf61810
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 2D204777C477B588

Datei anzeigen

@ -124,8 +124,12 @@ impl<'r> FromRequest<'r> for IpHeader {
} }
} }
fn admin_url(base_url: &str) -> String { fn admin_path() -> String {
format!("{}{}", base_url, ADMIN_PATH) format!("{}{}", CONFIG.domain_path(), ADMIN_PATH)
}
fn admin_url(origin: &str) -> String {
format!("{}{}", origin, admin_path())
} }
@ -198,7 +202,7 @@ fn post_admin_login(data: Form<LoginForm>, cookies: &CookieJar<'_>, ip: ClientIp
cookies.add(cookie); cookies.add(cookie);
if let Some(redirect) = redirect { if let Some(redirect) = redirect {
Ok(Redirect::to(format!("{}{}", ADMIN_PATH, redirect))) Ok(Redirect::to(format!("{}{}", admin_path(), redirect)))
} else { } else {
Err(AdminResponse::Ok(render_admin_page())) Err(AdminResponse::Ok(render_admin_page()))
} }
@ -731,7 +735,7 @@ async fn diagnostics(
"uses_proxy": uses_proxy, "uses_proxy": uses_proxy,
"db_type": *DB_TYPE, "db_type": *DB_TYPE,
"db_version": get_sql_server_version(&mut conn).await, "db_version": get_sql_server_version(&mut conn).await,
"admin_url": format!("{}/diagnostics", admin_url(&host_info.base_url)), "admin_url": format!("{}/diagnostics", admin_url(&host_info.origin)),
"overrides": &CONFIG.get_overrides().join(", "), "overrides": &CONFIG.get_overrides().join(", "),
"host_arch": std::env::consts::ARCH, "host_arch": std::env::consts::ARCH,
"host_os": std::env::consts::OS, "host_os": std::env::consts::OS,