1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-04 06:20:26 +00:00

Prevent multiple token refreshes

This commit is contained in:
M66B 2021-11-27 18:48:35 +01:00
parent 54ae31ef7d
commit 83556ed413

View file

@ -328,8 +328,9 @@ public class EmailService implements AutoCloseable {
@Override @Override
public void onPasswordChanged(Context context, String newPassword) { public void onPasswordChanged(Context context, String newPassword) {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
int accounts = db.account().setAccountPassword(account.id, newPassword); account.password = newPassword;
int identities = db.identity().setIdentityPassword(account.id, account.user, newPassword, account.auth_type); int accounts = db.account().setAccountPassword(account.id, account.password);
int identities = db.identity().setIdentityPassword(account.id, account.user, account.password, account.auth_type);
EntityLog.log(context, EntityLog.Type.Account, account, EntityLog.log(context, EntityLog.Type.Account, account,
"token refreshed=" + accounts + "/" + identities); "token refreshed=" + accounts + "/" + identities);
} }
@ -346,7 +347,8 @@ public class EmailService implements AutoCloseable {
@Override @Override
public void onPasswordChanged(Context context, String newPassword) { public void onPasswordChanged(Context context, String newPassword) {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
int count = db.identity().setIdentityPassword(identity.id, newPassword); identity.password = newPassword;
int count = db.identity().setIdentityPassword(identity.id, identity.password);
EntityLog.log(context, EntityLog.Type.Account, identity.account, null, null, EntityLog.log(context, EntityLog.Type.Account, identity.account, null, null,
identity.email + " token refreshed=" + count); identity.email + " token refreshed=" + count);