From 4e72e3d8ec66d1be1667c840b28ab35c32ebae46 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 21 Jan 2022 20:42:58 +0000 Subject: [PATCH] update actix-identity to aw4b21 --- actix-identity/Cargo.toml | 2 +- actix-identity/src/identity.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actix-identity/Cargo.toml b/actix-identity/Cargo.toml index 4627ccc46..f15037196 100644 --- a/actix-identity/Cargo.toml +++ b/actix-identity/Cargo.toml @@ -16,7 +16,7 @@ path = "src/lib.rs" [dependencies] actix-service = "2" actix-utils = "3" -actix-web = { version = "4.0.0-beta.18", default-features = false, features = ["cookies", "secure-cookies"] } +actix-web = { version = "4.0.0-beta.21", default-features = false, features = ["cookies", "secure-cookies"] } futures-util = { version = "0.3.7", default-features = false } serde = "1.0" diff --git a/actix-identity/src/identity.rs b/actix-identity/src/identity.rs index a2cf6bc8d..366e8303d 100644 --- a/actix-identity/src/identity.rs +++ b/actix-identity/src/identity.rs @@ -1,7 +1,7 @@ use actix_utils::future::{ready, Ready}; use actix_web::{ dev::{Extensions, Payload}, - Error, FromRequest, HttpRequest, + Error, FromRequest, HttpMessage as _, HttpRequest, }; pub(crate) struct IdentityItem { @@ -48,12 +48,12 @@ impl Identity { /// Return the claimed identity of the user associated request or `None` if no identity can be /// found associated with the request. pub fn identity(&self) -> Option { - Identity::get_identity(&self.0.req_data()) + Identity::get_identity(&self.0.extensions()) } /// Remember identity. pub fn remember(&self, identity: String) { - if let Some(id) = self.0.req_data_mut().get_mut::() { + if let Some(id) = self.0.extensions_mut().get_mut::() { id.id = Some(identity); id.changed = true; } @@ -61,7 +61,7 @@ impl Identity { /// This method is used to 'forget' the current identity on subsequent requests. pub fn forget(&self) { - if let Some(id) = self.0.req_data_mut().get_mut::() { + if let Some(id) = self.0.extensions_mut().get_mut::() { id.id = None; id.changed = true; }