cors for pow routes

This commit is contained in:
realaravinth
2021-04-11 23:40:36 +05:30
parent 0d1ba0d150
commit 8851b1f7b7
4 changed files with 40 additions and 10 deletions

View File

@@ -16,7 +16,7 @@
*/
//use actix_cors::Cors;
//use lazy_static::lazy_static;
use actix_web::web;
pub mod get_config;
pub mod verify_pow;
@@ -34,3 +34,24 @@ pub use super::mcaptcha::levels::I32Levels;
// .max_age(0)
// .send_wildcard();
//}
//pub fn services(cfg: &mut web::ServiceConfig) -> web::Scope<impl actix_service::ServiceFactory> {
// let captcha_api_cors = Cors::default()
// .allow_any_origin()
// .allowed_methods(vec!["POST"])
// .allow_any_header()
// .max_age(0)
// .send_wildcard();
//
// web::scope("/api/v1/pow/*")
// .wrap(captcha_api_cors)
// .configure(pow_services)
//
// // pow
//}
pub fn services(cfg: &mut web::ServiceConfig) {
cfg.service(get_config::get_config);
cfg.service(verify_pow::verify_pow);
cfg.service(verify_token::validate_captcha_token);
}