Updated auth checking roles
This commit is contained in:
@@ -112,21 +112,6 @@ async fn main() -> std::io::Result<()> {
|
||||
let port = env::var("SERVICE_PORT").unwrap_or("5000".to_string());
|
||||
|
||||
let server = match HttpServer::new(move || {
|
||||
// let private_key = actix_web::cookie::Key::generate();
|
||||
// let redis_host = env::var("REDIS_HOST").unwrap_or("localhost".to_string());
|
||||
// let redis_port = env::var("REDIS_PORT").unwrap_or("6379".to_string());
|
||||
// let session = SessionMiddleware::builder(
|
||||
// RedisActorSessionStore::new(format!("{}:{}", redis_host, redis_port)),
|
||||
// CookieSessionStore::default(),
|
||||
// private_key
|
||||
// )
|
||||
// .session_lifecycle(BrowserSession::default())
|
||||
// .cookie_name("auth".to_owned())
|
||||
// .cookie_secure(false)
|
||||
// .cookie_http_only(false)
|
||||
// .cookie_domain(Some("localhost".to_owned()))
|
||||
// .cookie_path("/".to_owned())
|
||||
// .build();
|
||||
let cors = Cors::default()
|
||||
.allow_any_origin()
|
||||
.allow_any_method()
|
||||
@@ -134,8 +119,6 @@ async fn main() -> std::io::Result<()> {
|
||||
.supports_credentials()
|
||||
.max_age(3600);
|
||||
App::new()
|
||||
// .wrap(IdentityMiddleware::default())
|
||||
// .wrap(session)
|
||||
.wrap(cors)
|
||||
.app_data(web::Data::new(Arc::clone(&app_data)))
|
||||
.configure(crate::db::messages::init_routes)
|
||||
|
||||
Reference in New Issue
Block a user