Skip to content

Commit 10f69c4

Browse files
committed
[FEAT/#400] 인터셉터 429 상태 추가
1 parent 6e95235 commit 10f69c4

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

core/network/src/main/java/com/terning/core/network/AuthInterceptor.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,16 @@ class AuthInterceptor @Inject constructor(
6161
terningDataStore.clearInfo()
6262

6363
Handler(Looper.getMainLooper()).post {
64-
Toast.makeText(context, TOKEN_EXPIRED_ERROR, Toast.LENGTH_LONG).show()
64+
Toast.makeText(context, MESSAGE_TOKEN_EXPIRED, Toast.LENGTH_LONG).show()
6565
ProcessPhoenix.triggerRebirth(context)
6666
}
6767
}
68+
69+
CODE_MANY_REQUESTS -> {
70+
Handler(Looper.getMainLooper()).post {
71+
Toast.makeText(context, MESSAGE_TOO_MANY_REQUESTS, Toast.LENGTH_LONG).show()
72+
}
73+
}
6874
}
6975
return response
7076
}
@@ -74,7 +80,9 @@ class AuthInterceptor @Inject constructor(
7480

7581
companion object {
7682
private const val CODE_TOKEN_EXPIRED = 401
77-
private const val TOKEN_EXPIRED_ERROR = "토큰이 만료되었어요\n다시 로그인 해주세요"
83+
private const val CODE_MANY_REQUESTS = 429
84+
private const val MESSAGE_TOKEN_EXPIRED = "토큰이 만료되었어요\n다시 로그인 해주세요"
85+
private const val MESSAGE_TOO_MANY_REQUESTS = "요청 횟수가 너무 많아요\n잠시 후 다시 시도해 주세요"
7886
private const val BEARER = "Bearer"
7987
private const val AUTHORIZATION = "Authorization"
8088
}

0 commit comments

Comments
 (0)