diff --git a/crates/auth/src/extractor.rs b/crates/auth/src/extractor.rs index 877a84f..8959633 100644 --- a/crates/auth/src/extractor.rs +++ b/crates/auth/src/extractor.rs @@ -8,6 +8,7 @@ use crate::error::Error; use super::{AuthInfo, CheckAuthentication}; +#[derive(Clone)] pub struct AuthInfoExtractor { pub inner: AuthInfo, pub _provider_type: PhantomData, @@ -29,14 +30,11 @@ where type Error = Error; type Future = Ready>; - fn extract(req: &HttpRequest) -> Self::Future { + fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future { let result = req.app_data::>().unwrap().validate(req); ready(result.map(|auth_info| Self { inner: auth_info, _provider_type: PhantomData, })) } - fn from_request(req: &HttpRequest, _payload: &mut Payload) -> Self::Future { - Self::extract(req) - } }