Prevent token refresh loop

pull/194/merge
M66B 3 years ago
parent 6b000d75ee
commit 3ceb1711cd

@ -136,7 +136,8 @@ public class ServiceAuthenticator extends Authenticator {
Log.e(ex); Log.e(ex);
} }
if (expiration != null && expiration - keep_alive < new Date().getTime()) long slack = Math.min(keep_alive, 30 * 60 * 1000L);
if (expiration != null && expiration - slack < new Date().getTime())
throw new IllegalStateException(Log.TOKEN_REFRESH_REQUIRED); throw new IllegalStateException(Log.TOKEN_REFRESH_REQUIRED);
} }

@ -2005,7 +2005,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
} }
// Check token expiration // Check token expiration
iservice.check(); if (!account.isTransient(this))
iservice.check();
// Sends store NOOP // Sends store NOOP
if (EmailService.SEPARATE_STORE_CONNECTION) { if (EmailService.SEPARATE_STORE_CONNECTION) {

Loading…
Cancel
Save