clearSessionPreference works again + test. Fixes #137615

This commit is contained in:
Tyler Leonhardt
2021-11-22 17:14:49 -08:00
parent 62853d0cf4
commit f4e58732b9
2 changed files with 49 additions and 25 deletions

View File

@@ -251,7 +251,9 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu
throw new Error('User did not consent to login.');
}
const session = await this.authenticationService.createSession(providerId, scopes, true);
const session = sessions?.length && !options.forceNewSession
? await this.authenticationService.selectSession(providerId, extensionId, extensionName, scopes, sessions)
: await this.authenticationService.createSession(providerId, scopes, true);
await this.setTrustedExtensionAndAccountPreference(providerId, session.account.label, extensionId, extensionName, session.id);
return session;
}