Fixes #95020, add extension to trusted list when confirming login

This commit is contained in:
Rachel Macfarlane
2020-04-11 13:27:11 -07:00
parent d54bee34d8
commit 335de3b713
3 changed files with 10 additions and 0 deletions

View File

@@ -317,4 +317,12 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu
return choice === 1;
}
async $setTrustedExtension(providerId: string, accountName: string, extensionId: string, extensionName: string): Promise<void> {
const allowList = readAllowedExtensions(this.storageService, providerId, accountName);
if (!allowList.find(allowed => allowed.id === extensionId)) {
allowList.push({ id: extensionId, name: extensionName });
this.storageService.store(`${providerId}-${accountName}`, JSON.stringify(allowList), StorageScope.GLOBAL);
}
}
}