Skip to content

Commit fbc7e34

Browse files
committed
apply JWTAuthentication to current APIs
1 parent 3365cf3 commit fbc7e34

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/attendee/api/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
from rest_framework.response import Response
44
from registry.helper import reg
55
from rest_framework.permissions import IsAuthenticated
6+
from rest_framework_simplejwt.authentication import JWTAuthentication
67

7-
from core.authentication import TokenAuthentication
88
from attendee.models import Attendee
99

1010

1111
class AttendeeAPIView(views.APIView):
12-
authentication_classes = [TokenAuthentication]
12+
authentication_classes = [JWTAuthentication]
1313
permission_classes = [IsAuthenticated]
1414

1515
model = Attendee

src/events/api/views.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
from rest_framework.views import APIView
55
from rest_framework.response import Response
66
from rest_framework.permissions import IsAuthenticated
7+
from rest_framework_simplejwt.authentication import JWTAuthentication
78

89
from django.conf import settings
910
from django.db.models import Count
1011
from django.http import Http404
1112

12-
from core.authentication import TokenAuthentication
1313
from events.models import (
1414
CustomEvent, Location, ProposedTalkEvent,
1515
ProposedTutorialEvent, SponsoredEvent, Time, KeynoteEvent
@@ -34,7 +34,7 @@ class TutorialListAPIView(ListAPIView):
3434

3535

3636
class SpeechListAPIView(APIView):
37-
authentication_classes = [TokenAuthentication]
37+
authentication_classes = [JWTAuthentication]
3838
permission_classes = [IsAuthenticated]
3939

4040
def get(self, request, *args, **kwargs):
@@ -76,7 +76,7 @@ class TutorialDetailAPIView(RetrieveAPIView):
7676

7777

7878
class SpeechDetailAPIView(APIView):
79-
authentication_classes = [TokenAuthentication]
79+
authentication_classes = [JWTAuthentication]
8080
permission_classes = [IsAuthenticated]
8181

8282
def get(self, request, *args, **kwargs):
@@ -213,7 +213,7 @@ def display(self):
213213

214214

215215
class ScheduleAPIView(APIView):
216-
authentication_classes = [TokenAuthentication]
216+
authentication_classes = [JWTAuthentication]
217217
permission_classes = [IsAuthenticated]
218218

219219
event_querysets = [
@@ -294,7 +294,7 @@ def get(self, request):
294294

295295

296296
class KeynoteEventListAPIView(ListAPIView):
297-
authentication_classes = [TokenAuthentication]
297+
authentication_classes = [JWTAuthentication]
298298
permission_classes = [IsAuthenticated]
299299

300300
queryset = KeynoteEvent.objects.all()

src/sponsors/api/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
from rest_framework import views
44
from rest_framework.response import Response
55
from rest_framework.permissions import IsAuthenticated
6+
from rest_framework_simplejwt.authentication import JWTAuthentication
67

7-
from core.authentication import TokenAuthentication
88
from sponsors.models import Sponsor, OpenRole
99

1010

1111
class SponsorAPIView(views.APIView):
12-
authentication_classes = [TokenAuthentication]
12+
authentication_classes = [JWTAuthentication]
1313
permission_classes = [IsAuthenticated]
1414

1515
def get(self, request):
@@ -42,7 +42,7 @@ def get(self, request):
4242

4343

4444
class JobAPIView(views.APIView):
45-
authentication_classes = [TokenAuthentication]
45+
authentication_classes = [JWTAuthentication]
4646
permission_classes = [IsAuthenticated]
4747

4848
def get(self, request):

0 commit comments

Comments
 (0)