Fakultas Ilmu Komputer UI

Commit fe819d52 authored by Glenda Emanuella Sutanto's avatar Glenda Emanuella Sutanto
Browse files

[REFACTOR] Change google view serializer to user auth serializer

parent a7af13ae
Pipeline #79695 passed with stages
in 11 minutes and 37 seconds
......@@ -11,7 +11,7 @@ from dietela_quiz.serializers import DietProfileSerializer
from payment.models import Cart
from payment.serializers import CartSerializer
from .models import CustomUser
from .serializers import CustomUserDetailsSerializer, CustomLoginSerializer
from .serializers import CustomUserDetailsSerializer, CustomLoginSerializer, UserAuthSerializer
from .google_utils import validate_google_token
from .utilities import get_first_deadline
......@@ -77,7 +77,7 @@ class GoogleView(APIView):
)
token = RefreshToken.for_user(user) # generate token
response = {}
response['user'] = CustomUserDetailsSerializer(user).data
response['user'] = UserAuthSerializer(user).data
response['access_token'] = str(token.access_token)
response['refresh_token'] = str(token)
return Response(response)
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