From 90bd66247dd1719b5d930e802e94b8b75ba657af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kol=C3=A1=C5=99?= Date: Fri, 10 Nov 2023 19:24:51 +0100 Subject: [PATCH] fix(esn-accounts): fix csrf fail for safari [closes #228] --- fiesta/apps/esnaccounts/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fiesta/apps/esnaccounts/views.py b/fiesta/apps/esnaccounts/views.py index da190ab8..a15f7f87 100644 --- a/fiesta/apps/esnaccounts/views.py +++ b/fiesta/apps/esnaccounts/views.py @@ -1,6 +1,7 @@ from __future__ import annotations from allauth_cas.views import CASAdapter, CASCallbackView, CASLoginView, CASLogoutView +from django.views.decorators.csrf import csrf_exempt from .provider import ESNAccountsProvider @@ -13,6 +14,7 @@ class ESNAccountsAdapter(CASAdapter): login = CASLoginView.adapter_view(ESNAccountsAdapter) -callback = CASCallbackView.adapter_view(ESNAccountsAdapter) +# see https://github.com/esnvutbrno/buena-fiesta/issues/228 +callback = csrf_exempt(CASCallbackView.adapter_view(ESNAccountsAdapter)) logout = CASLogoutView.adapter_view(ESNAccountsAdapter)