From 57286746d50fd656d3493ada761f92b9e2dbd0c7 Mon Sep 17 00:00:00 2001 From: comst19 Date: Wed, 17 Jan 2024 18:39:04 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Kakao=20Login=20=EC=84=B1=EA=B3=B5=20?= =?UTF-8?q?=EC=8B=9C=20=EC=82=AC=EC=9A=A9=EC=9E=90=EC=9D=98=20id,=20email,?= =?UTF-8?q?=20profileUrl=EC=9D=84=20=EB=84=98=EA=B2=A8=EC=A3=BC=EB=8A=94?= =?UTF-8?q?=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../archive/presentation/ui/auth/SignInFragment.kt | 1 + .../com/droidblossom/archive/util/SocialLoginUtil.kt | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/auth/SignInFragment.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/auth/SignInFragment.kt index aedddb36f..2de6cda5f 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/auth/SignInFragment.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/presentation/ui/auth/SignInFragment.kt @@ -2,6 +2,7 @@ package com.droidblossom.archive.presentation.ui.auth import android.app.Activity import android.os.Bundle +import android.util.Log import android.view.View import androidx.activity.result.contract.ActivityResultContracts import androidx.fragment.app.activityViewModels diff --git a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/util/SocialLoginUtil.kt b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/util/SocialLoginUtil.kt index a6186fbac..b12a0ebb9 100644 --- a/frontend/ARchive/app/src/main/java/com/droidblossom/archive/util/SocialLoginUtil.kt +++ b/frontend/ARchive/app/src/main/java/com/droidblossom/archive/util/SocialLoginUtil.kt @@ -36,7 +36,6 @@ class SocialLoginUtil(private val context: Context, private val callback: LoginC callback.onLoginFailure(error) } else if (token != null) { //Log.e("카카오", "로그인 성공 ${token.accessToken}") - //callback.onLoginSuccess(AuthViewModel.Social.KAKAO) kakaoGetUserInfo() } } @@ -47,7 +46,6 @@ class SocialLoginUtil(private val context: Context, private val callback: LoginC callback.onLoginFailure(error) } else if (token != null) { //Log.e("카카오", "로그인 성공 ${token.accessToken}") - //callback.onLoginSuccess(AuthViewModel.Social.KAKAO) kakaoGetUserInfo() } } @@ -59,11 +57,10 @@ class SocialLoginUtil(private val context: Context, private val callback: LoginC if (error != null) { Log.e("카카오", "사용자 정보 요청 실패", error) } else if (user != null) { - Log.i("카카오", "사용자 정보 요청 성공" + - "\n회원번호: ${user.id}" + - "\n이메일: ${user.kakaoAccount?.email}" + - "\n프로필사진: ${user.kakaoAccount?.profile?.thumbnailImageUrl}") - //callback.onLoginSuccess(user.id.toString(),AuthViewModel.Social.KAKAO) + val authId = user.id.toString() + val email = user.kakaoAccount?.email ?: "" + val profileUrl = user.kakaoAccount?.profile?.thumbnailImageUrl ?: "" + callback.onLoginSuccess(authId, email, profileUrl, AuthViewModel.Social.KAKAO) } } }