- switch if branch for easier readability

- show snackbar only for webview (for old login there is a decent error warning)
This commit is contained in:
tobiaskaminsky 2017-08-31 08:22:41 +02:00
parent 43747c8e76
commit 9174397939
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -1811,20 +1811,21 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
}
} else { // authorization fail due to client side - probably wrong credentials
if (!webViewLoginMethod) {
updateAuthStatusIconAndText(result);
showAuthStatus();
} else {
if (webViewLoginMethod) {
mLoginWebView = (WebView) findViewById(R.id.login_webview);
initWebViewLogin(mServerInfo.mBaseUrl);
Snackbar.make(mLoginWebView, getString(R.string.auth_access_failed) + ": " + result.getLogMessage(),
Snackbar.LENGTH_LONG).show();
} else {
updateAuthStatusIconAndText(result);
showAuthStatus();
}
// reset webview
webViewPassword = null;
webViewUser = null;
deleteCookies();
Snackbar.make(mLoginWebView, getString(R.string.auth_access_failed) + ": " + result.getLogMessage(),
Snackbar.LENGTH_LONG).show();
Log_OC.d(TAG, "Access failed: " + result.getLogMessage());
}
}