use axum::http::header;
use axum::response::{Html, IntoResponse as _, Response};
const LOGIN_HTML: &str = include_str!("../assets/login.html");
const LOGIN_JS: &str = include_str!("../assets/login.js");
const SET_PASSWORD_HTML: &str = include_str!("../assets/set_password.html");
const SET_PASSWORD_JS: &str = include_str!("../assets/set_password.js");
pub async fn login_page() -> Html<&'static str> {
Html(LOGIN_HTML)
}
pub async fn login_js() -> Response {
js_response(LOGIN_JS)
}
pub async fn set_password_page() -> Html<&'static str> {
Html(SET_PASSWORD_HTML)
}
pub async fn set_password_js() -> Response {
js_response(SET_PASSWORD_JS)
}
fn js_response(body: &'static str) -> Response {
(
[(
header::CONTENT_TYPE,
"application/javascript; charset=utf-8",
)],
body,
)
.into_response()
}