Prevent multiple token refreshes

pull/194/merge
M66B 4 years ago
parent 54ae31ef7d
commit 83556ed413

@ -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);

Loading…
Cancel
Save