handle: string to nativeHandle: UInt8Array based on feedback (#234378)

Feedback in https://github.com/microsoft/vscode/issues/229431
This commit is contained in:
Tyler James Leonhardt
2024-11-21 10:58:49 -08:00
committed by GitHub
parent 7662e03145
commit d7ab35a98e
8 changed files with 29 additions and 13 deletions

View File

@@ -190,7 +190,7 @@ export class MsalAuthProvider implements AuthenticationProvider {
let result: AuthenticationResult | undefined;
try {
const windowHandle = env.handle ? Buffer.from(env.handle, 'base64') : undefined;
const windowHandle = env.nativeHandle ? Buffer.from(env.nativeHandle) : undefined;
result = await cachedPca.acquireTokenInteractive({
openBrowser: async (url: string) => { await env.openExternal(Uri.parse(url)); },
scopes: scopeData.scopesToSend,
@@ -232,7 +232,7 @@ export class MsalAuthProvider implements AuthenticationProvider {
// The user wants to try the loopback client or we got an error likely due to spinning up the server
const loopbackClient = new UriHandlerLoopbackClient(this._uriHandler, redirectUri, this._logger);
try {
const windowHandle = env.handle ? Buffer.from(env.handle) : undefined;
const windowHandle = env.nativeHandle ? Buffer.from(env.nativeHandle) : undefined;
result = await cachedPca.acquireTokenInteractive({
openBrowser: (url: string) => loopbackClient.openBrowser(url),
scopes: scopeData.scopesToSend,