Files
RasadDam_Backend/apps/authentication/api/v1/api.py
2025-05-06 16:22:35 +03:30

35 lines
985 B
Python

from apps.authentication.api.v1.serializers.jwt import CustomizedTokenObtainPairSerializer
from rest_framework_simplejwt.authentication import JWTAuthentication
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework.viewsets import ModelViewSet
from rest_framework.decorators import action
from apps.authentication.models import User
from rest_framework.views import APIView
from django.db import transaction
class CustomizedTokenObtainPairView(TokenObtainPairView):
serializer_class = CustomizedTokenObtainPairSerializer
# Example Code
class Authentication(ModelViewSet):
queryset = User
serializer_class = ''
permission_classes = ''
authentication_classes = [JWTAuthentication]
@action(
methods=['post', ],
detail=False,
name='login',
url_name='login',
url_path='login'
)
@transaction.atomic
def login(self, request):
pass
class UserViewSet(ModelViewSet):
pass