1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-08-31 15:04:48 +00:00

Use absolute paths in the admin page

This commit is contained in:
Daniel García 2020-02-22 17:49:33 +01:00
commit 2f4a9865e1
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
3 changed files with 20 additions and 18 deletions

View file

@ -60,7 +60,7 @@ fn admin_path() -> String {
fn admin_login(flash: Option<FlashMessage>) -> ApiResult<Html<String>> {
// If there is an error, show it
let msg = flash.map(|msg| format!("{}: {}", msg.name(), msg.msg()));
let json = json!({"page_content": "admin/login", "version": VERSION, "error": msg});
let json = json!({"page_content": "admin/login", "version": VERSION, "error": msg, "urlpath": CONFIG.domain_path()});
// Return the page
let text = CONFIG.render_template(BASE_TEMPLATE, &json)?;
@ -115,6 +115,7 @@ struct AdminTemplateData {
config: Value,
can_backup: bool,
logged_in: bool,
urlpath: String,
}
impl AdminTemplateData {
@ -126,6 +127,7 @@ impl AdminTemplateData {
config: CONFIG.prepare_json(),
can_backup: *CAN_BACKUP,
logged_in: true,
urlpath: CONFIG.domain_path(),
}
}