fix(main): Update cookie session setup for new actix-web
This commit is contained in:
parent
f599f661ba
commit
4eb0a57177
1 changed files with 3 additions and 4 deletions
|
@ -36,7 +36,7 @@ pub mod schema;
|
||||||
|
|
||||||
use actix::prelude::*;
|
use actix::prelude::*;
|
||||||
use actix_web::*;
|
use actix_web::*;
|
||||||
use actix_web::middleware::{Logger, SessionStorage, CookieSessionBackendBuilder};
|
use actix_web::middleware::{Logger, SessionStorage, CookieSessionBackend};
|
||||||
use actix_web::http::Method;
|
use actix_web::http::Method;
|
||||||
use db::*;
|
use db::*;
|
||||||
use diesel::pg::PgConnection;
|
use diesel::pg::PgConnection;
|
||||||
|
@ -103,9 +103,8 @@ fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
let sessions = SessionStorage::new(
|
let sessions = SessionStorage::new(
|
||||||
CookieSessionBackendBuilder::new(&key)
|
CookieSessionBackend::signed(&key)
|
||||||
.secure(base_url.starts_with("https"))
|
.secure(base_url.starts_with("https")));
|
||||||
.finish());
|
|
||||||
|
|
||||||
App::with_state(state)
|
App::with_state(state)
|
||||||
.middleware(Logger::default())
|
.middleware(Logger::default())
|
||||||
|
|
Loading…
Reference in a new issue