18 lines
480 B
Rust
18 lines
480 B
Rust
use crate::app_config::AppConfig;
|
|
use crate::controllers::HttpResult;
|
|
use crate::extractors::auth_extractor::AuthExtractor;
|
|
use actix_web::HttpResponse;
|
|
|
|
#[derive(serde::Serialize)]
|
|
struct ServerConfig {
|
|
authenticated: bool,
|
|
disable_auth: bool,
|
|
}
|
|
|
|
pub async fn config(auth: AuthExtractor) -> HttpResult {
|
|
Ok(HttpResponse::Ok().json(ServerConfig {
|
|
authenticated: auth.is_authenticated(),
|
|
disable_auth: AppConfig::get().unsecure_disable_login,
|
|
}))
|
|
}
|