mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
depend on stable vscode.dev for auth extensions
This commit is contained in:
parent
14ad945c42
commit
39c6779828
|
@ -17,10 +17,12 @@ const localize = nls.loadMessageBundle();
|
|||
const CLIENT_ID = '01ab8ac9400c4e429b23';
|
||||
const GITHUB_AUTHORIZE_URL = 'https://github.com/login/oauth/authorize';
|
||||
// TODO: change to stable when that happens
|
||||
const GITHUB_TOKEN_URL = 'https://insiders.vscode.dev/codeExchangeProxyEndpoints/github/login/oauth/access_token';
|
||||
const REDIRECT_URL = 'https://insiders.vscode.dev/redirect';
|
||||
const GITHUB_TOKEN_URL = 'https://vscode.dev/codeExchangeProxyEndpoints/github/login/oauth/access_token';
|
||||
const NETWORK_ERROR = 'network error';
|
||||
|
||||
const REDIRECT_URL_STABLE = 'https://vscode.dev/redirect';
|
||||
const REDIRECT_URL_INSIDERS = 'https://insiders.vscode.dev/redirect';
|
||||
|
||||
class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler {
|
||||
constructor(private readonly Logger: Log) {
|
||||
super();
|
||||
|
@ -163,9 +165,12 @@ export class GitHubServer implements IGitHubServer {
|
|||
const existingNonces = this._pendingNonces.get(scopes) || [];
|
||||
this._pendingNonces.set(scopes, [...existingNonces, nonce]);
|
||||
|
||||
const proxyEndpoints: { [providerId: string]: string } | undefined = await vscode.commands.executeCommand('workbench.getCodeExchangeProxyEndpoints');
|
||||
// If we are running in insiders vscode.dev, then ensure we use the redirect route on that.
|
||||
const redirectUri = proxyEndpoints?.github?.includes('https://insiders.vscode.dev') ? REDIRECT_URL_INSIDERS : REDIRECT_URL_STABLE;
|
||||
const searchParams = new URLSearchParams([
|
||||
['client_id', CLIENT_ID],
|
||||
['redirect_uri', REDIRECT_URL],
|
||||
['redirect_uri', redirectUri],
|
||||
['scope', scopes],
|
||||
['state', encodeURIComponent(callbackUri.toString(true))]
|
||||
]);
|
||||
|
|
|
@ -20,8 +20,7 @@ import path = require('path');
|
|||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
// TODO: Change to stable when it's deployed.
|
||||
const redirectUrl = 'https://insiders.vscode.dev/redirect';
|
||||
const redirectUrl = 'https://vscode.dev/redirect';
|
||||
const loginEndpointUrl = 'https://login.microsoftonline.com/';
|
||||
const DEFAULT_CLIENT_ID = 'aebc6443-996d-45c2-90f0-388ff96faa56';
|
||||
const DEFAULT_TENANT = 'organizations';
|
||||
|
|
Loading…
Reference in a new issue