-
-
Save mchowning/0d4edda7247b536a5abccd20357cebb0 to your computer and use it in GitHub Desktop.
Force access token refresh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/sync/SyncManagerImpl.kt b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/sync/SyncManagerImpl.kt | |
index 2edc42f7..2c2a67fa 100644 | |
--- a/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/sync/SyncManagerImpl.kt | |
+++ b/modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/sync/SyncManagerImpl.kt | |
@@ -440,7 +440,8 @@ class SyncManagerImpl @Inject constructor( | |
private suspend fun <T : Any> getCacheTokenOrLogin(serverCall: suspend (token: AccessToken) -> T): T { | |
if (isLoggedIn()) { | |
return try { | |
- val token = syncAccountManager.getAccessToken() ?: refreshTokenSuspend() | |
+ // Forcing token refresh for testing purposes | |
+ val token = refreshTokenSuspend() | |
serverCall(token) | |
} catch (ex: Exception) { | |
// refresh invalid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment