Skip to main content

require_auth

Function require_auth 

Source
pub async fn require_auth(
    __arg0: State<Arc<AuthState>>,
    request: Request,
    next: Next,
) -> Result<Response, StatusCode>
Expand description

Axum middleware that validates Bearer token authentication.

§Errors

Returns 401 Unauthorized if the token is missing or invalid.