mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-25 10:33:45 +03:00
Merge pull request #506 from Jasper0819X/master
disable django_logout if REST_SESSION_LOGIN is False
This commit is contained in:
commit
c7cc41e07c
|
@ -121,7 +121,7 @@ class LogoutView(APIView):
|
||||||
request.user.auth_token.delete()
|
request.user.auth_token.delete()
|
||||||
except (AttributeError, ObjectDoesNotExist):
|
except (AttributeError, ObjectDoesNotExist):
|
||||||
pass
|
pass
|
||||||
|
if getattr(settings, 'REST_SESSION_LOGIN', True):
|
||||||
django_logout(request)
|
django_logout(request)
|
||||||
|
|
||||||
return Response({"detail": _("Successfully logged out.")},
|
return Response({"detail": _("Successfully logged out.")},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user