fix(main): Update cookie session setup for new actix-web

This commit is contained in:
Vincent Ambo 2018-04-10 09:53:58 +02:00
parent f599f661ba
commit 4eb0a57177

View file

@ -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())