Menu
Public repository / e20fdc20ba73ed38f462643569dcb30aa8cb2187
AkurAI-Drive / backend/src/pages.rs
Latest change 6e3a0824f4ec4d2bea2524a20b4960c7ab9e2766 - backend: akurai-drive-api (OIDC RP + per-tenant S3 provisioning) by olibuijr
use axum::{
http::{HeaderMap, StatusCode, header},
response::{Html, IntoResponse, Response},
};
use crate::session;
/// `GET /app` — the authenticated dashboard. Redirects to `/auth/login` without a
/// valid session, otherwise serves the dashboard HTML.
///
/// NOTE: `static/app.html` is the real dashboard, provided by a separate frontend
/// agent. A minimal placeholder is committed so the crate compiles standalone; the
/// real file replaces it without any code change here.
pub async fn app(headers: HeaderMap) -> Response {
match session::lookup_session(&headers) {
Some(_) => Html(include_str!("../static/app.html")).into_response(),
None => (StatusCode::FOUND, [(header::LOCATION, "/auth/login")]).into_response(),
}
}