Skip to main content

require_auth

Function require_auth 

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

Axum middleware that validates JWT bearer tokens on protected routes.

If auth is disabled (no secret configured), requests pass through. If auth is enabled, a valid Authorization: Bearer <token> is required.