diff options
Diffstat (limited to 'src/security.rs')
-rw-r--r-- | src/security.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/security.rs b/src/security.rs index fe9c26b..4a17fe3 100644 --- a/src/security.rs +++ b/src/security.rs @@ -6,9 +6,9 @@ use time::{Duration, OffsetDateTime}; pub use crate::signed::Key; -use crate::{Error, Request, Response}; +use crate::{Error, request::Parts, response::Response}; -/// A cookie-based CSRF token to be used with [`crate::Request::into_form_csrf`]. +/// A cookie-based CSRF token to be used with [`crate::request::Body::into_form_csrf`]. pub struct CsrfToken { token: String, from_client: bool, @@ -17,7 +17,7 @@ pub struct CsrfToken { impl CsrfToken { /// Retrieves the CSRF token from a `csrf` cookie or generates /// a new token and stores it as a cookie if it doesn't exist. - pub fn from_request(request: &mut Request, response: &mut Response) -> Self { + pub fn from_parts(request: &mut Parts, response: &mut Response) -> Self { if let Some(cookie) = request.cookies().get("csrf") { return CsrfToken{token: cookie.value().to_string(), from_client: true} } |