Skip to content

Commit

Permalink
Add default permissions for views
Browse files Browse the repository at this point in the history
  • Loading branch information
poxip committed Aug 3, 2017
1 parent 59da092 commit e259db6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jwt_devices/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from rest_framework import mixins, status, viewsets
from rest_framework.exceptions import NotFound
from rest_framework.generics import DestroyAPIView
from rest_framework.permissions import IsAuthenticated
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework_jwt.settings import api_settings as rfj_settings
Expand All @@ -23,6 +23,7 @@ class ObtainJSONWebTokenAPIView(OriginalObtainJSONWebToken):
API view used to obtain a JWT token along with creating a new Device object and returning permanent token.
"""
serializer_class = JSONWebTokenSerializer
permission_classes = [AllowAny]

def post(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.data)
Expand Down Expand Up @@ -58,6 +59,7 @@ class DeviceRefreshJSONWebToken(APIView):
API View used to refresh JSON Web Token using permanent token.
"""
serializer_class = DeviceTokenRefreshSerializer
permission_classes = [AllowAny]

def post(self, request):
serializer = self.serializer_class(data=request.META)
Expand Down

0 comments on commit e259db6

Please sign in to comment.