Skip to main content

require_auth

Function require_auth 

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

A middleware that extracts the PASETO token from the Authorization: Bearer <token> header, validates it, and injects the AuthPayload into the request extensions.