using custom version of actix-codegen and cors for pow routes

This commit is contained in:
realaravinth
2021-05-25 14:34:24 +05:30
parent 0421cb681c
commit 72667bd2e1
26 changed files with 334 additions and 363 deletions

View File

@@ -39,6 +39,7 @@ impl IndexPage {
const PAGE: &str = "Dashboard";
#[my_codegen::get(path = "crate::PAGES.panel.home", wrap = "crate::CheckLogin")]
async fn panel(data: web::Data<Data>, id: Identity) -> PageResult<impl Responder> {
let sitekeys = get_list_sitekeys(&data, &id).await?;
let body = IndexPage::new(sitekeys).render_once().unwrap();
@@ -48,10 +49,7 @@ async fn panel(data: web::Data<Data>, id: Identity) -> PageResult<impl Responder
}
pub fn services(cfg: &mut actix_web::web::ServiceConfig) {
use crate::define_resource;
use crate::PAGES;
define_resource!(cfg, PAGES.panel.home, Methods::ProtectGet, panel);
cfg.service(panel);
sitekey::services(cfg);
}