Browse Source

refactor(admin): return 503 status code when admin panel is disabled

pull/7494/head
spyesx 2 weeks ago
parent
commit
f852256d3f
  1. 7
      src/api/admin.rs

7
src/api/admin.rs

@ -98,8 +98,11 @@ static CAN_BACKUP: LazyLock<bool> = LazyLock::new(|| ACTIVE_DB_TYPE.get().is_som
static CAN_BACKUP: LazyLock<bool> = LazyLock::new(|| false); static CAN_BACKUP: LazyLock<bool> = LazyLock::new(|| false);
#[get("/")] #[get("/")]
fn admin_disabled() -> &'static str { fn admin_disabled() -> (Status, &'static str) {
"The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it" (
Status::ServiceUnavailable,
"The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it"
)
} }
const COOKIE_NAME: &str = "VW_ADMIN"; const COOKIE_NAME: &str = "VW_ADMIN";

Loading…
Cancel
Save