Add token expiration time to auth fail exceptions

This commit is contained in:
M66B 2024-01-25 14:37:07 +01:00
parent 37462d7da1
commit e52daaf895
1 changed files with 6 additions and 0 deletions

View File

@ -526,6 +526,12 @@ public class EmailService implements AutoCloseable {
msg != null && msg.endsWith("Invalid credentials (Failure)"))
msg += "\n" + context.getString(R.string.title_service_token);
if (auth == AUTH_TYPE_OAUTH) {
Long expiration = authenticator.getAccessTokenExpirationTime();
if (expiration != null && expiration < new Date().getTime())
msg = "Access token expired at " + new Date(expiration) + "\n" + msg;
}
Throwable c = ex1;
while (c != null) {
String m = c.getMessage();