I am using the JNON API for the Django rest web interface which is here on github ( https://github.com/GetBlimp/django-rest-framework-jwt/tree/master/ ).
I can successfully create tokens and use them to call secure REST APis. However, there are certain cases when I would like to delete a certain token before its expiration date. Therefore, I decided to do this with a view such as:
class Logout(APIView):
permission_classes = (IsAuthenticated, )
authentication_classes = (JSONWebTokenAuthentication, )
def post(self, request):
request.auth.delete()
return Response(status=status.HTTP_200_OK)
request.authis just a string object. This way, of course, this will not work, but I was not sure how I can clear the underlying token.
EDIT
, , , JWT . . ?