Functionsยง
- require_
auth - A middleware that extracts the PASETO token from the
Authorization: Bearer <token>header, validates it, and injects theAuthPayloadinto the request extensions. - require_
role - An extractor guard for RBAC (Role-Based Access Control).
Use it to protect routes, e.g.,
.route_layer(axum::middleware::from_fn(|req, next| require_role(req, next, "admin")))