Temp updated

This commit is contained in:
Benjamin Sherriff
2023-10-18 08:52:59 -04:00
parent 3b15f520c8
commit d3965efd28
6 changed files with 72 additions and 50 deletions

View File

@@ -6,8 +6,7 @@ use std::env;
use std::collections::HashSet;
use std::sync::Arc;
use actix_identity::IdentityMiddleware;
use actix_session::{SessionMiddleware, storage::{RedisActorSessionStore, CookieSessionStore}, config::{PersistentSession, BrowserSession, CookieContentSecurity}};
// use db::users::validator;
use actix_session::{SessionMiddleware, storage::{RedisActorSessionStore, CookieSessionStore}, config::BrowserSession};
use log::{error, warn, info};
use serenity::client::Cache;
use serenity::framework::StandardFramework;
@@ -16,7 +15,7 @@ use serenity::prelude::*;
use songbird::{SerenityInit, Songbird};
use actix_cors::Cors;
use actix_web::{HttpServer, App, web, cookie::{time::Duration, SameSite}};
use actix_web::{HttpServer, App, web};
use crate::bot::{commands::oai::GPTModel, handler::Handler};
use dotenv::dotenv;
@@ -114,7 +113,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 auth = HttpAuthentication::bearer(validator);
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());
@@ -127,7 +125,6 @@ async fn main() -> std::io::Result<()> {
.cookie_name("auth".to_owned())
.cookie_secure(false)
.cookie_http_only(false)
// .cookie_content_security(CookieContentSecurity::Private)
.cookie_domain(Some("localhost".to_owned()))
.cookie_path("/".to_owned())
.build();
@@ -137,9 +134,7 @@ async fn main() -> std::io::Result<()> {
.allow_any_header()
.supports_credentials()
.max_age(3600);
// let cors = Cors::permissive();
App::new()
// .wrap(auth)
.wrap(IdentityMiddleware::default())
.wrap(session)
.wrap(cors)