mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-30 21:41:46 +01:00
Portable mode improvements and bug fixes (#287063)
Disabled protocol handlers and registry updates on Windows in portable mode. Added API proposal to detect if VS Code is running in portable mode from extensions. Skipped protocol redirect in GitHub authentication in portable mode.
This commit is contained in:
@@ -87,7 +87,7 @@ export class LoopbackAuthServer implements ILoopbackServer {
|
||||
return this._startingRedirect.searchParams.get('state') ?? undefined;
|
||||
}
|
||||
|
||||
constructor(serveRoot: string, startingRedirect: string, callbackUri: string) {
|
||||
constructor(serveRoot: string, startingRedirect: string, callbackUri: string, isPortable: boolean) {
|
||||
if (!serveRoot) {
|
||||
throw new Error('serveRoot must be defined');
|
||||
}
|
||||
@@ -132,7 +132,11 @@ export class LoopbackAuthServer implements ILoopbackServer {
|
||||
throw new Error('Nonce does not match.');
|
||||
}
|
||||
deferred.resolve({ code, state });
|
||||
res.writeHead(302, { location: `/?redirect_uri=${encodeURIComponent(callbackUri)}${appNameQueryParam}` });
|
||||
if (isPortable) {
|
||||
res.writeHead(302, { location: `/?app_name=${encodeURIComponent(env.appName)}` });
|
||||
} else {
|
||||
res.writeHead(302, { location: `/?redirect_uri=${encodeURIComponent(callbackUri)}${appNameQueryParam}` });
|
||||
}
|
||||
res.end();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user