csrf¶
- class litestar.middleware.csrf.CSRFMiddleware¶
Bases:
MiddlewareProtocol
CSRF Middleware class.
This Middleware protects against attacks by setting a CSRF cookie with a token and verifying it in request headers.
- __init__(app: ASGIApp, config: CSRFConfig) None ¶
Initialize
CSRFMiddleware
.