Skip to content

Commit 03b6bda

Browse files
committed
develop fix: token authenticator 수정
1 parent 1b53433 commit 03b6bda

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

core/network/src/main/java/com/moneymong/moneymong/network/util/MoneyMongTokenAuthenticator.kt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.moneymong.moneymong.network.util
22

33
import com.moneymong.moneymong.domain.repository.TokenRepository
44
import com.moneymong.moneymong.network.BuildConfig
5-
import kotlinx.coroutines.flow.SharedFlow
65
import kotlinx.coroutines.runBlocking
76
import okhttp3.Authenticator
87
import okhttp3.Request
@@ -20,7 +19,6 @@ class MoneyMongTokenAuthenticator @Inject constructor(
2019
if (response.code == 401 && !isPathRefresh) {
2120
return runBlocking {
2221
var newRequest: Request? = null
23-
//로컬에서 리프레쉬 토큰 가져오기
2422
tokenRepository.getRefreshToken().onSuccess {
2523
tokenRepository.getUpdateToken(it)
2624
.onSuccess { token ->
@@ -39,23 +37,15 @@ class MoneyMongTokenAuthenticator @Inject constructor(
3937
}
4038
}
4139
.onFailure {
42-
//it
43-
//TODO 토큰 갱신 요청이 실패하거나 네트워크 문제 등으로 인해 갱신 되지 않았을 떄
44-
// 에러 화면
45-
}
46-
}
47-
.onFailure {
48-
//it
49-
//로컬에서 리프레쉬 토큰을 가져오지 못한 경우
5040
runBlocking {
5141
tokenRepository.notifyTokenUpdateFailed(true)
5242
}
5343
}
5444
}.onFailure {
55-
runBlocking {
56-
tokenRepository.notifyTokenUpdateFailed(true)
57-
}
45+
runBlocking {
46+
tokenRepository.notifyTokenUpdateFailed(true)
5847
}
48+
}
5949
newRequest
6050
}
6151
} else {

0 commit comments

Comments
 (0)