fix: AuthenticatedRequestInfo support any state

This commit is contained in:
GW_MC
2025-12-29 18:58:00 +08:00
parent 7a557d6e00
commit 481abd7f26

View File

@@ -10,12 +10,15 @@ pub struct AuthenticatedRequestInfo {
pub user_id: Uuid, pub user_id: Uuid,
} }
impl FromRequestParts<()> for AuthenticatedRequestInfo { impl<S> FromRequestParts<S> for AuthenticatedRequestInfo
where
S: Send + Sync,
{
type Rejection = StatusCode; type Rejection = StatusCode;
async fn from_request_parts( async fn from_request_parts(
parts: &mut axum::http::request::Parts, parts: &mut axum::http::request::Parts,
_state: &(), _state: &S,
) -> Result<Self, Self::Rejection> { ) -> Result<Self, Self::Rejection> {
let request_info = parts let request_info = parts
.extensions .extensions