Skip to content

Commit 954cbec

Browse files
If account is passed in, treat that as the preference for the call (microsoft#230352)
* If account is passed in, treat that as the preference for the call fixes microsoft#230343 * Improve conditional for the account preference
1 parent 2c4078a commit 954cbec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vs/workbench/api/browser/mainThreadAuthentication.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,12 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu
210210
this._removeAccountPreference(extensionId, providerId, scopes);
211211
}
212212

213-
const matchingAccountPreferenceSession = this._getAccountPreference(extensionId, providerId, scopes, sessions);
213+
const matchingAccountPreferenceSession =
214+
// If an account was passed in, that takes precedence over the account preference
215+
options.account
216+
// We only support one session per account per set of scopes so grab the first one here
217+
? sessions[0]
218+
: this._getAccountPreference(extensionId, providerId, scopes, sessions);
214219

215220
// Check if the sessions we have are valid
216221
if (!options.forceNewSession && sessions.length) {

0 commit comments

Comments
 (0)