Skip to content

Commit

Permalink
[FIX]카카오 로그인 계정 연결 안된 경우 에러처리 (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
ny2060 committed Apr 23, 2023
1 parent 3406089 commit b6b2dac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/src/main/java/org/sopt/havit/ui/sign/SignInViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -74,6 +73,8 @@ class SplashWithSignActivity :
kakaoLoginService.getUserNeedNewScopes { isGetUserInfo ->
if (isGetUserInfo) signInViewModel.getSignIn()
}
} else {
kakaoLoginService.setLoginWithAccount(signInViewModel.kakaoLoginCallback)
}
})
}
Expand Down

0 comments on commit b6b2dac

Please sign in to comment.