diff --git a/core/src/main/java/org/hisp/dhis/android/core/user/openid/OpenIDConnectHandlerImpl.kt b/core/src/main/java/org/hisp/dhis/android/core/user/openid/OpenIDConnectHandlerImpl.kt index 267cc4fa87..afdff166eb 100644 --- a/core/src/main/java/org/hisp/dhis/android/core/user/openid/OpenIDConnectHandlerImpl.kt +++ b/core/src/main/java/org/hisp/dhis/android/core/user/openid/OpenIDConnectHandlerImpl.kt @@ -33,6 +33,7 @@ import android.content.Intent import dagger.Reusable import io.reactivex.Observable import io.reactivex.Single +import io.reactivex.schedulers.Schedulers import javax.inject.Inject import net.openid.appauth.* import org.hisp.dhis.android.core.user.User @@ -71,9 +72,11 @@ internal class OpenIDConnectHandlerImpl @Inject constructor( Single.error(ex) } else { val response = AuthorizationResponse.fromIntent(intent)!! - downloadToken(response.createTokenExchangeRequest()).map { - logInCall.blockingLogInOpenIDConnect(serverUrl, it) - } + downloadToken(response.createTokenExchangeRequest()) + .observeOn(Schedulers.io()) + .map { + logInCall.blockingLogInOpenIDConnect(serverUrl, it) + } } } else { Single.error(RuntimeException("Unexpected intent or request code"))