Skip to content

Commit

Permalink
[System] TokenRepository, TokenApi 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
ajou4095 committed Feb 20, 2024
1 parent a5261dd commit ae1a4a8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/kotlin/ac/dnd/mour/android/MourApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ open class MourApplication : Application() {
Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
}
startActivity(intent)
tokenRepository.resetRefreshTokenInvalidFlag()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class MockTokenRepository @Inject constructor(
)
}

override suspend fun resetRefreshTokenInvalidFlag() {
_isRefreshTokenInvalid.value = false
}

private suspend fun randomShortDelay() {
delay(LongRange(100, 500).random())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ interface TokenRepository {
suspend fun refreshToken(
refreshToken: String
): Result<JwtToken>

suspend fun resetRefreshTokenInvalidFlag()
}

0 comments on commit ae1a4a8

Please sign in to comment.