v0.0.28 | Google 로그인 JWT 토큰에 커스텀 클레임 추가
All checks were successful
Build And Test / build-and-push (push) Successful in 2m45s

- GoogleLoginView: 커스텀 클레임(name, grade, email, sub, iss) 포함하도록 수정
- GoogleLinkWithPasswordView: 동일하게 커스텀 클레임 포함
- 일반 로그인과 동일한 JWT 페이로드 구조 유지

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 23:00:33 +09:00
parent 27d7101f0f
commit 96615e4b94
2 changed files with 5 additions and 6 deletions

View File

@ -7,7 +7,6 @@ from rest_framework.response import Response
from rest_framework import status
from rest_framework.permissions import IsAuthenticated, BasePermission
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework_simplejwt.tokens import RefreshToken
from rest_framework import generics
from django.conf import settings
from google.oauth2 import id_token
@ -1178,8 +1177,8 @@ class GoogleLoginView(APIView):
status=status.HTTP_403_FORBIDDEN
)
# JWT 토큰 발급
refresh = RefreshToken.for_user(user)
# JWT 토큰 발급 (커스텀 클레임 포함)
refresh = CustomTokenObtainPairSerializer.get_token(user)
access = refresh.access_token
# 기존 로그인 응답과 동일한 형식
@ -1272,8 +1271,8 @@ class GoogleLinkWithPasswordView(APIView):
logger.info(f"[GOOGLE LINK] user={email} | status=success | IP={ip} | UA={ua}")
span.add_event("Google account linked", attributes={"email": email})
# JWT 토큰 발급
refresh = RefreshToken.for_user(user)
# JWT 토큰 발급 (커스텀 클레임 포함)
refresh = CustomTokenObtainPairSerializer.get_token(user)
access = refresh.access_token
return Response({

View File

@ -1 +1 @@
v0.0.27
v0.0.28