mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-10 06:56:09 +08:00
HACK HACK HACK Allow querying account tokens by email address too.
We've got a plethora of "unique" ids for the same account and ot looks like a recent regression is preventing us from fetching an API token for an account from the keychain. This diff changes the AccountStore to be able to fetch data using an account's email address. Will figure how to do things better after launch. Test plan: Checked that it worked for a broken account.
This commit is contained in:
parent
1f0d46bcd7
commit
1d740240aa
1 changed files with 6 additions and 1 deletions
|
@ -78,10 +78,15 @@ class AccountStore extends NylasStore {
|
|||
// Load tokens using the new KeyManager method
|
||||
this._tokens = {}
|
||||
for (const account of this._accounts) {
|
||||
this._tokens[account.id] = {
|
||||
const credentials = {
|
||||
n1Cloud: KeyManager.getPassword(`${account.emailAddress}.n1Cloud`, {migrateFromService: "Nylas"}),
|
||||
localSync: KeyManager.getPassword(`${account.emailAddress}.localSync`, {migrateFromService: "Nylas"}),
|
||||
}
|
||||
this._tokens[account.id] = credentials;
|
||||
|
||||
// HACK HACK HACK. For some reason we're getting passed the wrong
|
||||
// id. Figure this out after launch.
|
||||
this._tokens[account.emailAddress] = credentials;
|
||||
}
|
||||
} catch (error) {
|
||||
NylasEnv.reportError(error)
|
||||
|
|
Loading…
Reference in a new issue