From 10f69c4cb454b65665b10633fe456e90b7ed98a9 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 18 Jun 2025 17:40:07 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[FEAT/#400]=20=EC=9D=B8=ED=84=B0=EC=85=89?= =?UTF-8?q?=ED=84=B0=20429=20=EC=83=81=ED=83=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/terning/core/network/AuthInterceptor.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt b/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt index cf8bf1eff..da37addd3 100644 --- a/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt +++ b/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt @@ -61,10 +61,16 @@ class AuthInterceptor @Inject constructor( terningDataStore.clearInfo() Handler(Looper.getMainLooper()).post { - Toast.makeText(context, TOKEN_EXPIRED_ERROR, Toast.LENGTH_LONG).show() + Toast.makeText(context, MESSAGE_TOKEN_EXPIRED, Toast.LENGTH_LONG).show() ProcessPhoenix.triggerRebirth(context) } } + + CODE_MANY_REQUESTS -> { + Handler(Looper.getMainLooper()).post { + Toast.makeText(context, MESSAGE_TOO_MANY_REQUESTS, Toast.LENGTH_LONG).show() + } + } } return response } @@ -74,7 +80,9 @@ class AuthInterceptor @Inject constructor( companion object { private const val CODE_TOKEN_EXPIRED = 401 - private const val TOKEN_EXPIRED_ERROR = "토큰이 만료되었어요\n다시 로그인 해주세요" + private const val CODE_MANY_REQUESTS = 429 + private const val MESSAGE_TOKEN_EXPIRED = "토큰이 만료되었어요\n다시 로그인 해주세요" + private const val MESSAGE_TOO_MANY_REQUESTS = "요청 횟수가 너무 많아요\n잠시 후 다시 시도해 주세요" private const val BEARER = "Bearer" private const val AUTHORIZATION = "Authorization" } From 8513e09b97d7b372523581560f56db63ad385376 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 18 Jun 2025 18:22:11 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[FEAT/#400]=20restartApp=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../terning/core/network/AuthInterceptor.kt | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt b/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt index da37addd3..232182f9d 100644 --- a/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt +++ b/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt @@ -58,18 +58,11 @@ class AuthInterceptor @Inject constructor( Timber.d(t.message) } - terningDataStore.clearInfo() - - Handler(Looper.getMainLooper()).post { - Toast.makeText(context, MESSAGE_TOKEN_EXPIRED, Toast.LENGTH_LONG).show() - ProcessPhoenix.triggerRebirth(context) - } + restartApp(MESSAGE_TOKEN_EXPIRED) } CODE_MANY_REQUESTS -> { - Handler(Looper.getMainLooper()).post { - Toast.makeText(context, MESSAGE_TOO_MANY_REQUESTS, Toast.LENGTH_LONG).show() - } + restartApp(MESSAGE_TOO_MANY_REQUESTS) } } return response @@ -78,6 +71,15 @@ class AuthInterceptor @Inject constructor( private fun Request.Builder.newAuthBuilder() = this.addHeader(AUTHORIZATION, "$BEARER ${terningDataStore.accessToken}") + private fun restartApp(message: String) { + terningDataStore.clearInfo() + + Handler(Looper.getMainLooper()).post { + Toast.makeText(context, message, Toast.LENGTH_LONG).show() + ProcessPhoenix.triggerRebirth(context) + } + } + companion object { private const val CODE_TOKEN_EXPIRED = 401 private const val CODE_MANY_REQUESTS = 429 From 7dd64cf152fba3cdc9c9266aadc06652dc636a72 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 18 Jun 2025 18:23:15 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[FEAT/#400]=20=EB=A9=94=EC=84=B8=EC=A7=80?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/terning/core/network/AuthInterceptor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt b/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt index 232182f9d..41c0c40a6 100644 --- a/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt +++ b/core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt @@ -84,7 +84,7 @@ class AuthInterceptor @Inject constructor( private const val CODE_TOKEN_EXPIRED = 401 private const val CODE_MANY_REQUESTS = 429 private const val MESSAGE_TOKEN_EXPIRED = "토큰이 만료되었어요\n다시 로그인 해주세요" - private const val MESSAGE_TOO_MANY_REQUESTS = "요청 횟수가 너무 많아요\n잠시 후 다시 시도해 주세요" + private const val MESSAGE_TOO_MANY_REQUESTS = "요청 횟수가 너무 많아요\n로그인 후 다시 시도해 주세요" private const val BEARER = "Bearer" private const val AUTHORIZATION = "Authorization" } From 5a028bec9d9f451e13ee261e620422866cb6d11e Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Fri, 20 Jun 2025 04:17:30 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[FEAT/#400]=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=97=85=EA=B7=B8=EB=A0=88=EC=9D=B4=EB=93=9C=201.3.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5eca7ca90..a4343b9d2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,8 @@ compileSdk = "35" minSdk = "28" targetSdk = "35" -versionName = "1.3.5" -versionCode = "103050" +versionName = "1.3.6" +versionCode = "103060" jvmTarget = "1.8" ## Android gradle plugin