mcaptcha/pages/auth/
login.rs1use actix_web::{HttpResponse, Responder};
7use lazy_static::lazy_static;
8use my_codegen::get;
9use sailfish::TemplateOnce;
10
11use crate::PAGES;
12
13#[derive(Clone, TemplateOnce)]
14#[template(path = "auth/login/index.html")]
15struct IndexPage;
16const PAGE: &str = "Login";
17
18impl Default for IndexPage {
19 fn default() -> Self {
20 IndexPage
21 }
22}
23
24lazy_static! {
25 static ref INDEX: String = IndexPage.render_once().unwrap();
26}
27
28#[get(path = "PAGES.auth.login")]
29pub async fn login() -> impl Responder {
30 HttpResponse::Ok()
31 .content_type("text/html; charset=utf-8")
32 .body(&**INDEX)
33}