Fakultas Ilmu Komputer UI

Commit 240b9fda authored by jahnsmichael's avatar jahnsmichael
Browse files

[REFACTOR] add swagger auto schema for authentication

parent b826ec8c
Pipeline #83178 passed with stages
in 2 minutes and 59 seconds
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models import Token
from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.response import Response
from rest_framework import status
from drf_yasg.utils import swagger_auto_schema
class CustomAuthToken(ObtainAuthToken):
@swagger_auto_schema(
request_body=AuthTokenSerializer
)
def post(self, request, *args, **kwargs):
request_data = request.data
request_data["username"] = request_data["username"].lower()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment