1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Update middleware.py

created new DisableCSRFMiddleware to mitigate CSRF cookie error after login
This commit is contained in:
lando814 2025-05-19 17:24:20 +02:00 committed by GitHub
parent 4646597b39
commit 2997e130ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,3 +19,13 @@ class ExceptionMiddleware:
) )
return render(request, "500.html", status=500) return render(request, "500.html", status=500)
# TODO: check connecting to host via VPN # TODO: check connecting to host via VPN
class DisableCSRFMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
setattr(request, '_dont_enforce_csrf_checks', True)
response = self.get_response(request)
return response