Skip to content

Commit

Permalink
trying: added authentication_classes
Browse files Browse the repository at this point in the history
  • Loading branch information
JJFlorian committed Apr 5, 2024
1 parent 36cb23e commit 608d2a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import generics, permissions, status, views, viewsets
from rest_framework.decorators import action
Expand Down Expand Up @@ -130,6 +131,7 @@ class ImportTaskListView(mixins.UserOrganizationMixin, generics.ListAPIView):

queryset = models.ImportTask.objects.all().order_by("-created")
serializer_class = serializers.ImportTaskSerializer
authentication_classes = [SessionAuthentication, BasicAuthentication]
permission_classes = [permissions.IsAuthenticated]
filter_backends = [DjangoFilterBackend]
filterset_fields = "__all__"
Expand Down Expand Up @@ -218,7 +220,7 @@ class UploadTaskListView(mixins.UserOrganizationMixin, generics.ListAPIView):

serializer_class = serializers.UploadTaskSerializer
queryset = models.UploadTask.objects.all().order_by("-created")

authentication_classes = [SessionAuthentication, BasicAuthentication]
permission_classes = [permissions.IsAuthenticated]

filter_backends = [DjangoFilterBackend]
Expand Down
4 changes: 1 addition & 3 deletions brostar_api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
CSRF_TRUSTED_ORIGINS = [
"http://localhost:4200",
"https://staging.brostar.nl",
"https://www.staging.brostar.nl",
]


Expand Down Expand Up @@ -202,8 +201,7 @@
"DEFAULT_AUTHENTICATION_CLASSES": (
"nens_auth_client.rest_framework.OAuth2TokenAuthentication",
"rest_framework.authentication.BasicAuthentication",
"rest_framework.authentication.TokenAuthentication",
# "rest_framework.authentication.SessionAuthentication",
"rest_framework.authentication.SessionAuthentication",
),
}

Expand Down

0 comments on commit 608d2a6

Please sign in to comment.