csrf¶
- class litestar.middleware.csrf.CSRFMiddleware¶
Bases:
ASGIMiddleware
CSRF Middleware class.
This Middleware protects against attacks by setting a CSRF cookie with a token and verifying it in request headers.
- __init__(config: CSRFConfig) None ¶
Initialize
CSRFMiddleware
.- Parameters:
config¶ – The CSRFConfig instance.