mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-10 19:26:35 +03:00
also for cookie deletion
This commit is contained in:
parent
2672263100
commit
46fd16700a
|
@ -133,8 +133,13 @@ class LogoutView(APIView):
|
|||
|
||||
django_logout(request)
|
||||
|
||||
return Response({"detail": _("Successfully logged out.")},
|
||||
status=status.HTTP_200_OK)
|
||||
response = Response({"detail": _("Successfully logged out.")},
|
||||
status=status.HTTP_200_OK)
|
||||
if getattr(settings, 'REST_USE_JWT', False):
|
||||
from rest_framework_jwt.settings import api_settings as jwt_settings
|
||||
if jwt_settings.JWT_AUTH_COOKIE:
|
||||
response.delete_cookie(jwt_settings.JWT_AUTH_COOKIE)
|
||||
return response
|
||||
|
||||
|
||||
class UserDetailsView(RetrieveUpdateAPIView):
|
||||
|
|
Loading…
Reference in New Issue
Block a user