28 lines
767 B
Python
28 lines
767 B
Python
from apps.authentication.api.v1.serializers.jwt import CustomizedTokenObtainPairSerializer
|
|
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 django.db import transaction
|
|
|
|
|
|
class CustomizedTokenObtainPairView(TokenObtainPairView):
|
|
serializer_class = CustomizedTokenObtainPairSerializer
|
|
|
|
|
|
class Authentication(ModelViewSet):
|
|
queryset = User
|
|
serializer_class = ''
|
|
permission_classes = ''
|
|
|
|
@action(
|
|
methods=['post', ],
|
|
detail=False,
|
|
name='login',
|
|
url_name='login',
|
|
url_path='login'
|
|
)
|
|
@transaction.atomic
|
|
def login(self, request):
|
|
pass
|