diff --git a/session/cookie-auth/Cargo.toml b/session/cookie-auth/Cargo.toml index 142daa1e..90265dfe 100644 --- a/session/cookie-auth/Cargo.toml +++ b/session/cookie-auth/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2021" [dependencies] -actix-web = "3" -actix-identity = "0.3" -env_logger = "0.8" -rand = "0.7" +actix-web = "4.0.0-beta.21" +actix-identity = "0.4.0-beta.8" +env_logger = "0.9.0" +rand = "0.8.4" diff --git a/session/cookie-auth/src/main.rs b/session/cookie-auth/src/main.rs index 11ce5b7b..175c74c6 100644 --- a/session/cookie-auth/src/main.rs +++ b/session/cookie-auth/src/main.rs @@ -12,12 +12,16 @@ async fn index(id: Identity) -> String { async fn login(id: Identity) -> HttpResponse { id.remember("user1".to_owned()); - HttpResponse::Found().header("location", "/").finish() + HttpResponse::Found() + .insert_header(("location", "/")) + .finish() } async fn logout(id: Identity) -> HttpResponse { id.forget(); - HttpResponse::Found().header("location", "/").finish() + HttpResponse::Found() + .insert_header(("location", "/")) + .finish() } #[actix_web::main]