Add: serialization for LogoutView

This commit is contained in:
Aroy-Art 2025-02-10 09:32:34 +01:00
parent cb5ec0fcbe
commit 141e08f0f4
Signed by: Aroy
GPG key ID: 583642324A1D2070
2 changed files with 8 additions and 0 deletions

View file

@ -0,0 +1,5 @@
from rest_framework import serializers
class LogoutSerializer(serializers.Serializer):
refresh = serializers.CharField()

View file

@ -3,10 +3,13 @@ from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from rest_framework_simplejwt.tokens import RefreshToken
from api.authentication.serializers import LogoutSerializer
# Logout View
class LogoutView(APIView):
permission_classes = [IsAuthenticated]
serializer_class = LogoutSerializer
def post(self, request):
try: