diff --git a/src/api/admin.rs b/src/api/admin.rs index 983fa75..ae1f3df 100644 --- a/src/api/admin.rs +++ b/src/api/admin.rs @@ -16,7 +16,7 @@ use crate::CONFIG; pub fn routes() -> Vec { if CONFIG.admin_token().is_none() { - return Vec::new(); + return routes![admin_disabled]; } routes![ @@ -31,6 +31,11 @@ pub fn routes() -> Vec { ] } +#[get("/")] +fn admin_disabled() -> &'static str { + "The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it" +} + const COOKIE_NAME: &str = "BWRS_ADMIN"; const ADMIN_PATH: &str = "/admin";