mirror of https://git.42l.fr/neil/sncf.git
create sncf_cookies actix session
This commit is contained in:
parent
c24b98bcca
commit
112ea773a2
10
src/main.rs
10
src/main.rs
|
@ -7,6 +7,9 @@ extern crate diesel;
|
|||
#[macro_use]
|
||||
extern crate diesel_migrations;
|
||||
|
||||
|
||||
use actix_session::CookieSession;
|
||||
use actix_web::cookie::SameSite;
|
||||
use actix_files::Files;
|
||||
use actix_web::client::Client;
|
||||
use actix_web::{web, App, FromRequest, HttpServer};
|
||||
|
@ -89,6 +92,13 @@ async fn main() -> std::io::Result<()> {
|
|||
.data(pool.clone())
|
||||
.data(Client::new())
|
||||
.data(forward_url.clone())
|
||||
.wrap(
|
||||
CookieSession::signed(&[0; 32])
|
||||
.secure(true)
|
||||
.same_site(SameSite::Strict)
|
||||
.http_only(true)
|
||||
.name("sncf_cookies")
|
||||
)
|
||||
/*.route("/mimolette", web::get().to(login))*/
|
||||
/*.route("/login", web::post().to(forward))*/
|
||||
/*.wrap(middleware::Compress::default())*/
|
||||
|
|
Loading…
Reference in New Issue