Add support for updating refresh tokens if they are returned during access token update

This commit is contained in:
Ben Gotow 2021-04-10 21:11:48 -05:00
parent 09a09d4680
commit a516c472f2
5 changed files with 7 additions and 4 deletions

View file

@ -416,6 +416,10 @@ export default class MailsyncBridge {
OnlineStatusStore.onSyncProcessStateReceived(modelJSONs[0]);
continue;
}
if (modelClass === 'ProcessAccountSecretsUpdated' && modelJSONs.length) {
KeyManager.extractAndStoreAccountSecrets(new Account(modelJSONs[0]));
continue;
}
// dispatch the message to other windows
ipcRenderer.send('mailsync-bridge-rebroadcast-to-all', msg);

View file

@ -227,7 +227,7 @@ class _AccountStore extends MailspringStore {
// send the account JSON and cloud token to the KeyManager,
// which gives us back a version with no secrets.
const cleanAccount = await KeyManager.extractAccountSecrets(account);
const cleanAccount = await KeyManager.extractAndStoreAccountSecrets(account);
this._loadAccounts();

View file

@ -35,7 +35,6 @@ const VERIFIED_LANGS = [
'ko',
'pl',
'ja',
'ko',
'zh-CN',
'zh-TW',
'pt',

View file

@ -31,7 +31,7 @@ class KeyManager {
}
}
async extractAccountSecrets(account: Account) {
async extractAndStoreAccountSecrets(account: Account) {
try {
const keys = await this._getKeyHash();
keys[`${account.emailAddress}-imap`] = account.settings.imap_password;

@ -1 +1 @@
Subproject commit c4577574c6f989b639de1aa2a26c993589d63ed0
Subproject commit e079b209eb5e23195df59a12ffbac9503320029a