From 5ecd1aab663485d8096dc2ef83cff526dbfe025a Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 29 Sep 2018 12:45:56 +0000 Subject: [PATCH] Fixed expired SMTP OAUTH tokens --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 7145383d..7a194b46 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1272,7 +1272,8 @@ public class ServiceSynchronize extends LifecycleService { itransport.connect(ident.host, ident.port, ident.user, ident.password); } catch (AuthenticationFailedException ex) { if (ident.auth_type == Helper.AUTH_TYPE_GMAIL) { - ident.password = Helper.refreshToken(this, "com.google", ident.user, ident.password); + EntityAccount account = db.account().getAccount(ident.account); + ident.password = Helper.refreshToken(this, "com.google", ident.user, account.password); DB.getInstance(this).identity().setIdentityPassword(ident.id, ident.password); itransport.connect(ident.host, ident.port, ident.user, ident.password); } else