Files
romm/backend/handler/auth_handler/middleware.py
2024-01-12 23:44:27 +01:00

12 lines
388 B
Python

from starlette.types import Receive, Scope, Send
from starlette_csrf.middleware import CSRFMiddleware
class CustomCSRFMiddleware(CSRFMiddleware):
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
if scope["type"] != "http":
await self.app(scope, receive, send)
return
await super().__call__(scope, receive, send)