mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-25 15:32:52 +00:00
Prevent token refresh loop
This commit is contained in:
parent
6b000d75ee
commit
3ceb1711cd
2 changed files with 4 additions and 2 deletions
|
@ -136,7 +136,8 @@ public class ServiceAuthenticator extends Authenticator {
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -2005,7 +2005,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
}
|
||||
|
||||
// Check token expiration
|
||||
iservice.check();
|
||||
if (!account.isTransient(this))
|
||||
iservice.check();
|
||||
|
||||
// Sends store NOOP
|
||||
if (EmailService.SEPARATE_STORE_CONNECTION) {
|
||||
|
|
Loading…
Reference in a new issue