From ba75611b57610a2ed28fb5af4782f6e8af6ff613 Mon Sep 17 00:00:00 2001 From: Christian Carnero Date: Wed, 23 Nov 2022 18:31:10 -0300 Subject: [PATCH] fix 'cannot move out of secret_key ...' error and 'unused import: rand::Rng ...' warning (#588) --- auth/cookie-auth/src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/auth/cookie-auth/src/main.rs b/auth/cookie-auth/src/main.rs index facfbf72..4cb62ece 100644 --- a/auth/cookie-auth/src/main.rs +++ b/auth/cookie-auth/src/main.rs @@ -3,8 +3,6 @@ use actix_session::{storage::CookieSessionStore, SessionMiddleware}; use actix_web::{ cookie::Key, middleware, web, App, HttpMessage as _, HttpRequest, HttpResponse, HttpServer, }; -use rand::Rng; - async fn index(id: Identity) -> String { format!( "Hello {}", @@ -42,7 +40,7 @@ async fn main() -> std::io::Result<()> { App::new() .wrap(IdentityMiddleware::default()) .wrap( - SessionMiddleware::builder(CookieSessionStore::default(), secret_key) + SessionMiddleware::builder(CookieSessionStore::default(), secret_key.clone()) .cookie_name("auth-example".to_owned()) .cookie_secure(false) .build(),