From 789834c0ed0f77354d7bd68852d52ae9484d430e Mon Sep 17 00:00:00 2001 From: Junghoon Kim Date: Sun, 26 Jan 2025 20:35:00 +0900 Subject: [PATCH] :bug: fixed naver login bugs --- .../socialLogin/handler/CustomAuthenticationSuccessHandler.kt | 2 +- src/main/resources/application.yaml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/toyProject7/karrot/socialLogin/handler/CustomAuthenticationSuccessHandler.kt b/src/main/kotlin/com/toyProject7/karrot/socialLogin/handler/CustomAuthenticationSuccessHandler.kt index b59095b..5d84393 100644 --- a/src/main/kotlin/com/toyProject7/karrot/socialLogin/handler/CustomAuthenticationSuccessHandler.kt +++ b/src/main/kotlin/com/toyProject7/karrot/socialLogin/handler/CustomAuthenticationSuccessHandler.kt @@ -92,7 +92,7 @@ class CustomAuthenticationSuccessHandler( ): String { return when (provider) { "google" -> attributes["name"] as String - "naver" -> (attributes["response"] as Map<*, *>)["name"] as String + "naver" -> (attributes["response"] as Map<*, *>)["nickname"] as String "kakao" -> { val kakaoAccount = attributes["kakao_account"] as Map<*, *> val profile = kakaoAccount["profile"] as Map<*, *> diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index d6fa4fe..5fed258 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -29,9 +29,8 @@ spring: authorizationGrantType: authorization_code redirectUri: "https://toykarrot.shop/{action}/oauth2/code/{registrationId}" scope: - - nickname + - profile - email - - profile_image clientName: Naver kakao: clientId: '${KAKAO_CLI_ID}' @@ -41,7 +40,6 @@ spring: redirectUri: "https://toykarrot.shop/{action}/oauth2/code/{registrationId}" scope: - profile_nickname - - profile_image - account_email clientName: Kakao provider: