show password component

This commit is contained in:
realaravinth
2021-05-14 16:33:18 +05:30
parent bb6cc840ea
commit 6b740a980b
13 changed files with 285 additions and 7 deletions

View File

@@ -25,6 +25,7 @@ use serde::{Deserialize, Serialize};
use super::mcaptcha::get_random;
use crate::errors::*;
use crate::Data;
use crate::*;
pub mod routes {
pub struct Auth {
@@ -47,13 +48,17 @@ pub mod routes {
}
}
//post!(V1_API_ROUTES.auth.register, signup);
pub fn services(cfg: &mut web::ServiceConfig) {
use crate::define_resource;
use crate::V1_API_ROUTES;
// protect_get!(cfg, V1_API_ROUTES.auth.logout, signout);
//cfg.service(signup);
define_resource!(cfg, V1_API_ROUTES.auth.register, Methods::Post, signup);
define_resource!(cfg, V1_API_ROUTES.auth.logout, Methods::ProtectGet, signout);
define_resource!(cfg, V1_API_ROUTES.auth.login, Methods::Post, signin);
//post!(cfg, V1_API_ROUTES.auth.login, signin);
}
#[derive(Clone, Debug, Deserialize, Serialize)]

View File

@@ -17,6 +17,7 @@
use actix_cors::Cors;
use actix_web::web;
use actix_web::*;
pub mod get_config;
pub mod verify_pow;
@@ -68,4 +69,19 @@ pub mod routes {
}
}
}
}
#[allow(non_camel_case_types, missing_docs)]
pub struct post;
impl actix_web::dev::HttpServiceFactory for post {
fn register(self, __config: &mut actix_web::dev::AppService) {
async fn post() -> impl Responder {
HttpResponse::Ok()
}
let __resource = actix_web::Resource::new("/test/post")
.guard(actix_web::guard::Post())
.to(post);
actix_web::dev::HttpServiceFactory::register(__resource, __config)
}
}