From b6b2dacbf96f3692526059e452bb18a7f0c5f8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A1=E1=86=AB=E1=84=82=E1=85=A1=E1=84=8B?= =?UTF-8?q?=E1=85=A7=E1=86=BC?= Date: Mon, 24 Apr 2023 01:02:23 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=EC=B9=B4=EC=B9=B4=EC=98=A4=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=EA=B3=84=EC=A0=95=20=EC=97=B0=EA=B2=B0=20?= =?UTF-8?q?=EC=95=88=EB=90=9C=20=EA=B2=BD=EC=9A=B0=20=EC=97=90=EB=9F=AC?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20(#836)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/org/sopt/havit/ui/sign/SignInViewModel.kt | 4 +++- .../java/org/sopt/havit/ui/sign/SplashWithSignActivity.kt | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/sopt/havit/ui/sign/SignInViewModel.kt b/app/src/main/java/org/sopt/havit/ui/sign/SignInViewModel.kt index 6701655c..9d3e6bc2 100644 --- a/app/src/main/java/org/sopt/havit/ui/sign/SignInViewModel.kt +++ b/app/src/main/java/org/sopt/havit/ui/sign/SignInViewModel.kt @@ -45,7 +45,9 @@ class SignInViewModel @Inject constructor( val kakaoLoginCallback: (OAuthToken?, Throwable?) -> Unit = { token, error -> if (error != null) { - _isSuccessKakaoLogin.value = Event(false) + if (error.toString().contains("statusCode=302")) { + _isSuccessKakaoLogin.value = Event(false) + } Log.d("TAG", "카카오계정으로 로그인 실패 ${error}") } else if (token != null) { Log.d("TAG", "카카오계정으로 로그인 성공 ${token.accessToken}") diff --git a/app/src/main/java/org/sopt/havit/ui/sign/SplashWithSignActivity.kt b/app/src/main/java/org/sopt/havit/ui/sign/SplashWithSignActivity.kt index 3aab6d97..87c1bbac 100644 --- a/app/src/main/java/org/sopt/havit/ui/sign/SplashWithSignActivity.kt +++ b/app/src/main/java/org/sopt/havit/ui/sign/SplashWithSignActivity.kt @@ -5,7 +5,6 @@ import android.content.Intent import android.os.Bundle import android.view.animation.Animation import android.view.animation.AnimationUtils -import android.widget.Toast import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.viewModels import dagger.hilt.android.AndroidEntryPoint @@ -74,6 +73,8 @@ class SplashWithSignActivity : kakaoLoginService.getUserNeedNewScopes { isGetUserInfo -> if (isGetUserInfo) signInViewModel.getSignIn() } + } else { + kakaoLoginService.setLoginWithAccount(signInViewModel.kakaoLoginCallback) } }) }