From 141e08f0f4fd2f8ebf460110f6f71c3a29ffd54f Mon Sep 17 00:00:00 2001 From: Aroy-Art Date: Mon, 10 Feb 2025 09:32:34 +0100 Subject: [PATCH] Add: serialization for LogoutView --- backend/api/authentication/serializers.py | 5 +++++ backend/api/authentication/views.py | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 backend/api/authentication/serializers.py diff --git a/backend/api/authentication/serializers.py b/backend/api/authentication/serializers.py new file mode 100644 index 0000000..48a4620 --- /dev/null +++ b/backend/api/authentication/serializers.py @@ -0,0 +1,5 @@ +from rest_framework import serializers + + +class LogoutSerializer(serializers.Serializer): + refresh = serializers.CharField() diff --git a/backend/api/authentication/views.py b/backend/api/authentication/views.py index 10fbcd5..a9faa32 100644 --- a/backend/api/authentication/views.py +++ b/backend/api/authentication/views.py @@ -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: