Skip to content

Commit

Permalink
PlatformUserLogoutView updated
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakdinesh1123 committed May 16, 2024
1 parent d64e1a7 commit 182b43d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions backend/src/zango/apps/shared/platformauth/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from django.contrib.auth.views import LoginView
from django.contrib.auth.views import LoginView, LogoutView
from django.shortcuts import redirect
from django.contrib.auth import logout
from rest_framework.views import APIView


# Create your views here.
Expand All @@ -17,11 +15,11 @@ def post(self, request, *args, **kwargs):
return redirect("/platform")


class PlatformUserLogoutView(APIView):
class PlatformUserLogoutView(LogoutView):
"""
View to logout the user.
"""

def get(self, request, *args, **kwargs):
logout(request)
super().get(request, *args, **kwargs)
return redirect("/auth/login")

0 comments on commit 182b43d

Please sign in to comment.