Daniel García
6 years ago
No known key found for this signature in database
GPG Key ID: FC8A7D14C3CD543A
1 changed files with
6 additions and
1 deletions
-
src/api/admin.rs
|
|
@ -16,7 +16,7 @@ use crate::CONFIG; |
|
|
|
|
|
|
|
pub fn routes() -> Vec<Route> { |
|
|
|
if CONFIG.admin_token().is_none() { |
|
|
|
return Vec::new(); |
|
|
|
return routes![admin_disabled]; |
|
|
|
} |
|
|
|
|
|
|
|
routes![ |
|
|
@ -31,6 +31,11 @@ pub fn routes() -> Vec<Route> { |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
#[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"; |
|
|
|
|
|
|
|