Add: serialization for LogoutView
This commit is contained in:
parent
cb5ec0fcbe
commit
141e08f0f4
2 changed files with 8 additions and 0 deletions
5
backend/api/authentication/serializers.py
Normal file
5
backend/api/authentication/serializers.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from rest_framework import serializers
|
||||
|
||||
|
||||
class LogoutSerializer(serializers.Serializer):
|
||||
refresh = serializers.CharField()
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue