diff --git a/Cargo.lock b/Cargo.lock index aac09615..c1c51b6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -281,7 +281,7 @@ dependencies = [ "actix-threadpool", "actix-tls", "actix-utils", - "actix-web-codegen", + "actix-web-codegen 0.4.0", "awc", "bytes 0.5.6", "derive_more", @@ -314,6 +314,16 @@ dependencies = [ "syn", ] +[[package]] +name = "actix-web-codegen" +version = "0.5.0-beta.2" +source = "git+https://github.com/realaravinth/actix-web#b91607bfb263d101c4a33b2b9b01b2093c1713d0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "actix_derive" version = "0.5.0" @@ -1301,6 +1311,7 @@ dependencies = [ "actix-rt", "actix-service", "actix-web", + "actix-web-codegen 0.5.0-beta.2", "argon2-creds", "cache-buster", "config", diff --git a/Cargo.toml b/Cargo.toml index 4a143b41..19b5518b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ actix-http = "2.2" actix-rt = "1" actix-cors= "0.5.4" actix-service = "1.0.6" +my-codegen = {package = "actix-web-codegen", git ="https://github.com/realaravinth/actix-web"} mime_guess = "2.0.3" diff --git a/src/api/v1/auth.rs b/src/api/v1/auth.rs index e73cad72..7d282840 100644 --- a/src/api/v1/auth.rs +++ b/src/api/v1/auth.rs @@ -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, diff --git a/src/pages/auth/login.rs b/src/pages/auth/login.rs index 0e1d87b6..0c35790d 100644 --- a/src/pages/auth/login.rs +++ b/src/pages/auth/login.rs @@ -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) diff --git a/src/pages/auth/mod.rs b/src/pages/auth/mod.rs index 80303104..7a72bc51 100644 --- a/src/pages/auth/mod.rs +++ b/src/pages/auth/mod.rs @@ -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); } diff --git a/templates/components/headers.html b/templates/components/headers.html index 6a32c2c2..d69aa4e4 100644 --- a/templates/components/headers.html +++ b/templates/components/headers.html @@ -8,7 +8,7 @@ @@ -36,7 +36,8 @@ property="og:description" content="mCaptcha is an AGPL'd, privacy focued, proof-of-work based CAPTCHA System" /> - + - - + diff --git a/templates/components/showPassword/main.scss b/templates/components/showPassword/main.scss index 474d0b5a..aa1a20f3 100644 --- a/templates/components/showPassword/main.scss +++ b/templates/components/showPassword/main.scss @@ -18,10 +18,11 @@ @import '../../vars'; $img-height: 0.69; +$img-width: #{$form-input-height * $img-height}; @mixin show-password-img { display: block; - width: #{$form-input-height * $img-height}; + width: $img-width; } .show-password--show { @@ -34,9 +35,9 @@ $img-height: 0.69; } .show-password-container { - position: absolute; - right: 40px; - margin-top: #{$form-input-height * $img-height / 2.5}; + position: relative; + top: -#{$form-input-height * ($img-height * 1.15)}; + left: #{$form-content-width * 0.99}; } .show-password-container:hover {