diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index 9123b2d1..b20c1b1c 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -115,7 +115,7 @@ const authOptions: NextAuthOptions = { let nickname; if (platformType === 'KAKAO') { // 카카오는 항상 nickname을 제공 - nickname = (profile as KakaoProfile)?.nickname; + nickname = (profile as KakaoProfile)?.properties?.nickname; } else if (platformType === 'APPLE') { if (appleFirstInfo?.name) { // 애플 최초 로그인시에만 이름 정보 사용 diff --git a/lib/types/next-auth.d.ts b/lib/types/next-auth.d.ts index 6840be08..91ad30ee 100644 --- a/lib/types/next-auth.d.ts +++ b/lib/types/next-auth.d.ts @@ -37,13 +37,6 @@ declare module 'next-auth' { name?: string | null; image?: string | null; } - - interface Profile extends KakaoProfile { - sub?: string; - email?: string; - name?: string; - image?: string; - } } export interface AppleRequest { @@ -60,8 +53,21 @@ export interface AppleUserInfo { lastName?: string; }; } - -export interface KakaoProfile { - nickname?: string; - [key: string]: unknown; +interface KakaoProfile { + id: number; + connected_at: string; + properties: { + nickname: string; + }; + kakao_account: { + profile_nickname_needs_agreement: boolean; + profile: { + nickname: string; + }; + has_email: boolean; + email_needs_agreement: boolean; + is_email_valid: boolean; + is_email_verified: boolean; + email: string; + }; }