diff --git a/data/src/main/java/org/cryptomator/data/cloud/onedrive/graph/MSAAuthAndroidAdapter.java b/data/src/main/java/org/cryptomator/data/cloud/onedrive/graph/MSAAuthAndroidAdapter.java index cc901de8..a9b1a723 100644 --- a/data/src/main/java/org/cryptomator/data/cloud/onedrive/graph/MSAAuthAndroidAdapter.java +++ b/data/src/main/java/org/cryptomator/data/cloud/onedrive/graph/MSAAuthAndroidAdapter.java @@ -152,7 +152,7 @@ public abstract class MSAAuthAndroidAdapter implements IAuthenticationAdapter { public void onAuthComplete(final LiveStatus status, final LiveConnectSession session, final Object userState) { Timber.tag("MSAAuthAndroidAdapter").d(String.format("LiveStatus: %s, LiveConnectSession good?: %s, UserState %s", status, session != null, userState)); - if (status == LiveStatus.NOT_CONNECTED) { + if (status == LiveStatus.NOT_CONNECTED && session.getRefreshToken() == null) { Timber.tag("MSAAuthAndroidAdapter").d("Received invalid login failure from silent authentication, ignoring."); return; } diff --git a/presentation/src/foss/java/org/cryptomator/presentation/presenter/AuthenticateCloudPresenter.kt b/presentation/src/foss/java/org/cryptomator/presentation/presenter/AuthenticateCloudPresenter.kt index 1c76fb07..a8fee1c0 100644 --- a/presentation/src/foss/java/org/cryptomator/presentation/presenter/AuthenticateCloudPresenter.kt +++ b/presentation/src/foss/java/org/cryptomator/presentation/presenter/AuthenticateCloudPresenter.kt @@ -112,7 +112,9 @@ class AuthenticateCloudPresenter @Inject constructor( // } private fun failAuthentication(cloudName: Int) { - view?.showMessage(String.format(getString(R.string.screen_authenticate_auth_authentication_failed), getString(cloudName))) + activity().runOnUiThread { + view?.showMessage(String.format(getString(R.string.screen_authenticate_auth_authentication_failed), getString(cloudName))) + } finish() } diff --git a/presentation/src/notFoss/java/org/cryptomator/presentation/presenter/AuthenticateCloudPresenter.kt b/presentation/src/notFoss/java/org/cryptomator/presentation/presenter/AuthenticateCloudPresenter.kt index 14bcac5a..35095a8f 100644 --- a/presentation/src/notFoss/java/org/cryptomator/presentation/presenter/AuthenticateCloudPresenter.kt +++ b/presentation/src/notFoss/java/org/cryptomator/presentation/presenter/AuthenticateCloudPresenter.kt @@ -116,7 +116,9 @@ class AuthenticateCloudPresenter @Inject constructor( // } private fun failAuthentication(cloudName: Int) { - view?.showMessage(String.format(getString(R.string.screen_authenticate_auth_authentication_failed), getString(cloudName))) + activity().runOnUiThread { + view?.showMessage(String.format(getString(R.string.screen_authenticate_auth_authentication_failed), getString(cloudName))) + } finish() }