show password compoenent

This commit is contained in:
realaravinth
2021-05-15 21:36:52 +05:30
parent 6b740a980b
commit 0421cb681c
7 changed files with 33 additions and 10 deletions

View File

@@ -27,6 +27,8 @@ use crate::errors::*;
use crate::Data;
use crate::*;
pub const AUTH: routes::Auth = routes::Auth::new();
pub mod routes {
pub struct Auth {
pub login: &'static str,

View File

@@ -18,6 +18,8 @@
use actix_web::{HttpResponse, Responder};
use lazy_static::lazy_static;
use sailfish::TemplateOnce;
use my_codegen::get;
use crate::PAGES;
#[derive(Clone, TemplateOnce)]
#[template(path = "auth/login/index.html")]
@@ -35,7 +37,11 @@ lazy_static! {
static ref INDEX: String = IndexPage::default().render_once().unwrap();
}
const ROUTE: &str = PAGES.auth.login;
#[get(path="ROUTE")]
pub async fn login() -> impl Responder {
struct Foo;
HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.body(&*INDEX)

View File

@@ -22,7 +22,8 @@ pub fn services(cfg: &mut actix_web::web::ServiceConfig) {
use crate::define_resource;
use crate::PAGES;
define_resource!(cfg, PAGES.auth.login, Methods::Get, login::login);
cfg.service(login::login);
// define_resource!(cfg, PAGES.auth.login, Methods::Get, login::login);
define_resource!(cfg, PAGES.auth.join, Methods::Get, register::join);
}