Function auth_middleware

Source
pub async fn auth_middleware(req: Request, next: Next) -> Result<Response>
Expand description

Axum middleware for authentication.

Accepts Authorization header from a request and validates it. Afterwards, it’ll decode the JWT token and inject the user’s details into the request.