1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-13 17:32:56 +00:00

Include new isServerVersionSupported parameter to log out <10 accounts

This commit is contained in:
davigonz
2019-12-03 18:14:09 +01:00
parent 8ba4fa5960
commit 20e4317bd9
2 changed files with 11 additions and 6 deletions
@@ -381,16 +381,19 @@ public class OwnCloudClient extends HttpClient {
* cannot be invalidated with the given arguments.
*/
private boolean shouldInvalidateAccountCredentials(int httpStatusCode) {
boolean isServerVersionSupported = AccountUtils.getServerVersionForAccount(getAccount().getSavedAccount(),
getContext()).isServerVersionSupported();
boolean should = (httpStatusCode == HttpConstants.HTTP_UNAUTHORIZED); // invalid credentials
boolean shouldInvalidateAccountCredentials =
(httpStatusCode == HttpConstants.HTTP_UNAUTHORIZED || !isServerVersionSupported);
should &= (mCredentials != null && // real credentials
shouldInvalidateAccountCredentials &= (mCredentials != null && // real credentials
!(mCredentials instanceof OwnCloudCredentialsFactory.OwnCloudAnonymousCredentials));
// test if have all the needed to effectively invalidate ...
should &= (mAccount != null && mAccount.getSavedAccount() != null && getContext() != null);
shouldInvalidateAccountCredentials &= (mAccount != null && mAccount.getSavedAccount() != null && getContext() != null);
return should;
return shouldInvalidateAccountCredentials;
}
/**