From 013d0f37be1da41a714ec48a19f7f34240add0a4 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Fri, 17 Jul 2015 23:58:16 +0100 Subject: [PATCH] Extended JWT expiry time --- api/urls.py | 7 +++++-- dss/settings.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/urls.py b/api/urls.py index ce510ef..edd15f8 100755 --- a/api/urls.py +++ b/api/urls.py @@ -1,7 +1,9 @@ from django.conf.urls import patterns, url, include from rest_framework import permissions +from rest_framework.permissions import IsAuthenticated from rest_framework.routers import DefaultRouter from rest_framework.views import APIView +from rest_framework_jwt.authentication import JSONWebTokenAuthentication from api import views, auth, helpers from api.auth import FacebookView @@ -21,11 +23,12 @@ router.register(r'genre', views.GenreViewSet, base_name='genre') class DebugView(APIView): - permission_classes = (permissions.AllowAny,) + permission_classes = (IsAuthenticated, ) + authentication_classes = (JSONWebTokenAuthentication, ) def post(self, request, format=None): return Response({ - 'status': 'Hello', + 'status': request.user.first_name, 'message': 'Sailor' }, status=status.HTTP_200_OK) diff --git a/dss/settings.py b/dss/settings.py index e7bc4ed..a91bf7a 100755 --- a/dss/settings.py +++ b/dss/settings.py @@ -220,7 +220,7 @@ SITE_NAME = 'Deep South Sounds' THUMBNAIL_PREFIX = 'cache/_tn/' JWT_AUTH = { - 'JWT_EXPIRATION_DELTA': timedelta(seconds=1800), + 'JWT_EXPIRATION_DELTA': timedelta(seconds=900), 'JWT_ALLOW_REFRESH': True, 'JWT_REFRESH_EXPIRATION_DELTA': timedelta(days=30), } \ No newline at end of file