From 8323f23561fcd58ec2f601f230f4cc4c61202533 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 25 May 2020 17:28:47 +0300 Subject: [PATCH] Add a nop for api/logout/ It's there for etesync.com and is used to invalidate the token. Unfortunately we can't fully implement it here because the token implementation is lacking. This will be fixed soon once we update the token library with the next version of the protocol. --- etesync_server/urls.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etesync_server/urls.py b/etesync_server/urls.py index 6a079de..feb8892 100644 --- a/etesync_server/urls.py +++ b/etesync_server/urls.py @@ -34,6 +34,8 @@ from django.views.generic import TemplateView from rest_framework_nested import routers from rest_framework.authtoken import views as token_views +from rest_framework.decorators import api_view +from rest_framework.response import Response from journal import views @@ -47,11 +49,17 @@ journals_router.register(r'members', views.MembersViewSet, basename='journal-mem journals_router.register(r'entries', views.EntryViewSet, basename='journal-entries') +@api_view(['POST']) +def nop_view(request): + return Response({}) + + urlpatterns = [ re_path(r'^api/v1/', include(router.urls)), re_path(r'^api/v1/', include(journals_router.urls)), re_path(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), re_path(r'^api-token-auth/', token_views.obtain_auth_token), + path('api/logout/', nop_view), path('admin/', admin.site.urls), path('', TemplateView.as_view(template_name='success.html')), ]