Skip to content

Commit

Permalink
test logs (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
icrc-fdeniger authored Oct 8, 2024
1 parent ef79d3e commit 9969a4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ publishing {
register<MavenPublication>("default") {
groupId = android.namespace
artifactId = "coreapp"
version = "0.1-SNAPSHOT"
version = "0.1.1-SNAPSHOT"

afterEvaluate {
from(components["default"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private constructor(

fun getAccessToken(): String {
return runBlocking {
if (authStateManager.current.needsTokenRefresh and authStateManager.current.isAuthorized) {
if (authStateManager.current.needsTokenRefresh and authStateManager.current.isAuthorized && (authStateManager.current.refreshToken !=null)) {
Timber.i("Refreshing access token")
refreshAccessToken()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ class SplashActivity : AppCompatActivity() {
insets
}
authStateManager = AuthStateManager.getInstance(applicationContext)
if (authStateManager.current.isAuthorized) {
//TODO: fix that point for real offline mode
//by removing needsTokenRefresh we have an exception later on net.openid.appauth.AuthState.mRefreshToken being null
// in this method: net.openid.appauth.AuthState.createTokenRefreshRequest(java.util.Map<java.lang.String,java.lang.String>)
if (authStateManager.current.isAuthorized && !authStateManager.current.needsTokenRefresh) {
startActivity(Intent(this, MainActivity::class.java))
} else {
startActivity(Intent(this, LoginActivity::class.java))
Expand Down

0 comments on commit 9969a4e

Please sign in to comment.