1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2024-12-26 07:38:36 -06:00

chg: Allow insecure cookies

This commit is contained in:
Sayantan Santra 2023-10-08 18:20:34 -05:00
parent 57d390a129
commit f6255566b0
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -127,10 +127,11 @@ async fn main() -> std::io::Result<()> {
// Actually start the server // Actually start the server
HttpServer::new(move || { HttpServer::new(move || {
App::new() App::new()
.wrap(SessionMiddleware::new( .wrap(
CookieSessionStore::default(), SessionMiddleware::builder(CookieSessionStore::default(), secret_key.clone())
secret_key.clone(), .cookie_secure(false)
)) .build(),
)
// Maintain a single instance of database throughout // Maintain a single instance of database throughout
.app_data(web::Data::new(AppState { .app_data(web::Data::new(AppState {
db: database::open_db(env::var("db_url").unwrap_or(db_location.clone())), db: database::open_db(env::var("db_url").unwrap_or(db_location.clone())),