diff --git a/app/src/main/kotlin/ac/dnd/mour/android/MourApplication.kt b/app/src/main/kotlin/ac/dnd/mour/android/MourApplication.kt index 1ba38033..aa9f9ce0 100644 --- a/app/src/main/kotlin/ac/dnd/mour/android/MourApplication.kt +++ b/app/src/main/kotlin/ac/dnd/mour/android/MourApplication.kt @@ -94,6 +94,7 @@ open class MourApplication : Application() { Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK } startActivity(intent) + tokenRepository.resetRefreshTokenInvalidFlag() } } } diff --git a/data/src/main/kotlin/ac/dnd/mour/android/data/repository/authentication/token/MockTokenRepository.kt b/data/src/main/kotlin/ac/dnd/mour/android/data/repository/authentication/token/MockTokenRepository.kt index 618e0f39..4b10bbca 100644 --- a/data/src/main/kotlin/ac/dnd/mour/android/data/repository/authentication/token/MockTokenRepository.kt +++ b/data/src/main/kotlin/ac/dnd/mour/android/data/repository/authentication/token/MockTokenRepository.kt @@ -36,6 +36,10 @@ class MockTokenRepository @Inject constructor( ) } + override suspend fun resetRefreshTokenInvalidFlag() { + _isRefreshTokenInvalid.value = false + } + private suspend fun randomShortDelay() { delay(LongRange(100, 500).random()) } diff --git a/data/src/main/kotlin/ac/dnd/mour/android/data/repository/authentication/token/RealTokenRepository.kt b/data/src/main/kotlin/ac/dnd/mour/android/data/repository/authentication/token/RealTokenRepository.kt index c003b0a4..eb583ef2 100644 --- a/data/src/main/kotlin/ac/dnd/mour/android/data/repository/authentication/token/RealTokenRepository.kt +++ b/data/src/main/kotlin/ac/dnd/mour/android/data/repository/authentication/token/RealTokenRepository.kt @@ -44,6 +44,10 @@ class RealTokenRepository @Inject constructor( } } + override suspend fun resetRefreshTokenInvalidFlag() { + _isRefreshTokenInvalid.value = false + } + companion object { private const val REFRESH_TOKEN = "refresh_token" private const val ACCESS_TOKEN = "access_token" diff --git a/domain/src/main/kotlin/ac/dnd/mour/android/domain/repository/TokenRepository.kt b/domain/src/main/kotlin/ac/dnd/mour/android/domain/repository/TokenRepository.kt index dab0ef32..26261318 100644 --- a/domain/src/main/kotlin/ac/dnd/mour/android/domain/repository/TokenRepository.kt +++ b/domain/src/main/kotlin/ac/dnd/mour/android/domain/repository/TokenRepository.kt @@ -14,4 +14,6 @@ interface TokenRepository { suspend fun refreshToken( refreshToken: String ): Result + + suspend fun resetRefreshTokenInvalidFlag() }