Skip to content

Views

APITokenObtainPairView

Bases: TokenObtainPairView

Source code in API/authenticate/views.py
21
22
23
24
25
26
27
28
29
30
class APITokenObtainPairView(TokenObtainPairView):
    serializer_class = APITokenObtainPairSerializer

    @swagger_auto_schema(
        operation_description="Obtain JSON Web Token pair for user",
        responses={200: APIReturnTokenSerializer},
    )
    def post(self, request, *args, **kwargs):
        """Override the post method to add custom swagger documentation."""
        return super().post(request, *args, **kwargs)

post(request, *args, **kwargs)

Override the post method to add custom swagger documentation.

Source code in API/authenticate/views.py
24
25
26
27
28
29
30
@swagger_auto_schema(
    operation_description="Obtain JSON Web Token pair for user",
    responses={200: APIReturnTokenSerializer},
)
def post(self, request, *args, **kwargs):
    """Override the post method to add custom swagger documentation."""
    return super().post(request, *args, **kwargs)