Add /ping/ API route to check if user's token is valid
This commit is contained in:
parent
ee520b8c3f
commit
26845a5921
|
@ -250,6 +250,14 @@ class UserView(views.APIView):
|
|||
return Response(serializer.data)
|
||||
|
||||
|
||||
class PingView(views.APIView):
|
||||
permission_classes = [AllowMetadata | IsAuthenticated]
|
||||
|
||||
def post(self, request):
|
||||
return Response(200)
|
||||
|
||||
|
||||
|
||||
class DoorViewSet(viewsets.ViewSet, List):
|
||||
def list(self, request):
|
||||
cards = models.Card.objects.filter(active_status='card_active')
|
||||
|
|
|
@ -29,5 +29,6 @@ urlpatterns = [
|
|||
url(r'^registration/', views.RegistrationView.as_view(), name='rest_name_register'),
|
||||
url(r'^password/change/', views.PasswordChangeView.as_view(), name='rest_password_change'),
|
||||
url(r'^user/', views.UserView.as_view(), name='user'),
|
||||
url(r'^ping/', views.PingView.as_view(), name='ping'),
|
||||
url(IPN_ROUTE, views.IpnView.as_view(), name='ipn'),
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user