Skip to content

Commit

Permalink
Release/1.1.13 (#184)
Browse files Browse the repository at this point in the history
* [Hotfix] 401 else 처리 (#183)

* version 1.1.13
  • Loading branch information
HI-JIN2 authored Apr 6, 2024
1 parent 332a6bd commit 9294f79
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android {
applicationId "com.eatssu.android"
minSdk 23
targetSdk 34
versionCode 14
versionName "1.1.12"
versionCode 15
versionName "1.1.13"


buildConfigField("String", "KAKAO_NATIVE_APP_KEY", "\"${properties.get('KAKAO_NATIVE_APP_KEY')}\"")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,27 @@ class TokenInterceptor @Inject constructor(
refreshTokenResponse.close()
val newRequest = originalRequest.newAuthBuilder().build()
return chain.proceed(newRequest)
} else {
/*
refreshTokenResponse : Response{protocol=http/1.1, code=401, message=, url=https://prod.eat-ssu.shop/oauths/reissue/token}
μœ„ μƒν™©μ—μ„œλ„ λ‘œκ·Έμ•„μ›ƒ
**λ¦¬ν”„λ ˆμ‰¬λ„ μƒν•œ μƒνƒœ
*/
runBlocking { logoutUseCase() }
Timber.e("μž¬λ°œκΈ‰μ—μ„œμ˜ 401")

Handler(Looper.getMainLooper()).post {
val context = App.appContext
Toast.makeText(context, "토큰이 λ§Œλ£Œλ˜μ–΄ λ‘œκ·Έμ•„μ›ƒ λ©λ‹ˆλ‹€.", Toast.LENGTH_SHORT).show()
val intent = Intent(context, LoginActivity::class.java) // 둜그인 ν™”λ©΄μœΌλ‘œ 이동
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
context.startActivity(intent)
}
}

} catch (e: Exception) {
runBlocking { logoutUseCase() }
Timber.tag(TAG).d("μž¬λ°œκΈ‰ μ‹€νŒ¨ " + e)
Timber.e("μž¬λ°œκΈ‰ μ‹€νŒ¨ $e")

Handler(Looper.getMainLooper()).post {
val context = App.appContext
Expand Down

0 comments on commit 9294f79

Please sign in to comment.