Fix cookies not being set on new frontend deployment

This commit is contained in:
wvffle 2022-12-13 13:58:11 +00:00
parent 1e30620e92
commit 57ca334887
2 changed files with 4 additions and 1 deletions

View File

@ -1173,7 +1173,7 @@ Examples:
- ``^api/mycustompath/`` - ``^api/mycustompath/``
""" """
CSRF_USE_SESSIONS = True CSRF_USE_SESSIONS = False
SESSION_ENGINE = "django.contrib.sessions.backends.cache" SESSION_ENGINE = "django.contrib.sessions.backends.cache"
ACCOUNT_USERNAME_BLACKLIST = [ ACCOUNT_USERNAME_BLACKLIST = [

View File

@ -4,6 +4,8 @@ import logging
from cache_memoize import cache_memoize from cache_memoize import cache_memoize
from django.conf import settings from django.conf import settings
from django.urls import reverse from django.urls import reverse
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import ensure_csrf_cookie
from drf_spectacular.utils import extend_schema from drf_spectacular.utils import extend_schema
from dynamic_preferences.api import viewsets as preferences_viewsets from dynamic_preferences.api import viewsets as preferences_viewsets
from dynamic_preferences.api.serializers import GlobalPreferenceSerializer from dynamic_preferences.api.serializers import GlobalPreferenceSerializer
@ -55,6 +57,7 @@ class InstanceSettings(generics.GenericAPIView):
return Response(data, status=200) return Response(data, status=200)
@method_decorator(ensure_csrf_cookie, name="dispatch")
class NodeInfo(views.APIView): class NodeInfo(views.APIView):
permission_classes = [] permission_classes = []
authentication_classes = [] authentication_classes = []