mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
more staging detection (#121769)
* more staging detection * check for scheme
This commit is contained in:
parent
ad3e7ea1c0
commit
7b23ff442e
|
@ -81,7 +81,9 @@ export class GitHubServer {
|
|||
const existingStates = this._pendingStates.get(scopes) || [];
|
||||
this._pendingStates.set(scopes, [...existingStates, state]);
|
||||
|
||||
const uri = vscode.Uri.parse(`https://${AUTH_RELAY_SERVER}/authorize/?callbackUri=${encodeURIComponent(callbackUri.toString())}&scope=${scopes}&state=${state}&responseType=code&authServer=https://github.com`);
|
||||
// TODO@joaomoreno TODO@RMacfarlane
|
||||
const staging = callbackUri.scheme === 'https' && /^vscode\./.test(callbackUri.authority);
|
||||
const uri = vscode.Uri.parse(`https://${staging ? AUTH_RELAY_STAGING_SERVER : AUTH_RELAY_SERVER}/authorize/?callbackUri=${encodeURIComponent(callbackUri.toString())}&scope=${scopes}&state=${state}&responseType=code&authServer=https://github.com${staging ? '&staging=true' : ''}`);
|
||||
await vscode.env.openExternal(uri);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue