mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-30 21:41:46 +01:00
Have Loopback Server flow redirect back to VS Code and make it the primary flow (#251333)
* Have Loopback Server flow redirect back to VS Code and make it the primary flow Fixes https://github.com/microsoft/vscode/issues/250086 * Fix test * Fix test * Fix other test
This commit is contained in:
committed by
GitHub
parent
7766411d9f
commit
31620a3dec
@@ -82,7 +82,7 @@ export class LoopbackAuthServer implements ILoopbackServer {
|
||||
return this._startingRedirect.searchParams.get('state') ?? undefined;
|
||||
}
|
||||
|
||||
constructor(serveRoot: string, startingRedirect: string) {
|
||||
constructor(serveRoot: string, startingRedirect: string, callbackUri: string) {
|
||||
if (!serveRoot) {
|
||||
throw new Error('serveRoot must be defined');
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export class LoopbackAuthServer implements ILoopbackServer {
|
||||
throw new Error('Nonce does not match.');
|
||||
}
|
||||
deferred.resolve({ code, state });
|
||||
res.writeHead(302, { location: '/' });
|
||||
res.writeHead(302, { location: `/?redirect_uri=${encodeURIComponent(callbackUri)}` });
|
||||
res.end();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user