mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 19:59:37 +00:00
depend on stable vscode.dev for auth extensions
This commit is contained in:
@@ -17,10 +17,12 @@ const localize = nls.loadMessageBundle();
|
|||||||
const CLIENT_ID = '01ab8ac9400c4e429b23';
|
const CLIENT_ID = '01ab8ac9400c4e429b23';
|
||||||
const GITHUB_AUTHORIZE_URL = 'https://github.com/login/oauth/authorize';
|
const GITHUB_AUTHORIZE_URL = 'https://github.com/login/oauth/authorize';
|
||||||
// TODO: change to stable when that happens
|
// TODO: change to stable when that happens
|
||||||
const GITHUB_TOKEN_URL = 'https://insiders.vscode.dev/codeExchangeProxyEndpoints/github/login/oauth/access_token';
|
const GITHUB_TOKEN_URL = 'https://vscode.dev/codeExchangeProxyEndpoints/github/login/oauth/access_token';
|
||||||
const REDIRECT_URL = 'https://insiders.vscode.dev/redirect';
|
|
||||||
const NETWORK_ERROR = 'network error';
|
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 {
|
class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler {
|
||||||
constructor(private readonly Logger: Log) {
|
constructor(private readonly Logger: Log) {
|
||||||
super();
|
super();
|
||||||
@@ -163,9 +165,12 @@ export class GitHubServer implements IGitHubServer {
|
|||||||
const existingNonces = this._pendingNonces.get(scopes) || [];
|
const existingNonces = this._pendingNonces.get(scopes) || [];
|
||||||
this._pendingNonces.set(scopes, [...existingNonces, nonce]);
|
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([
|
const searchParams = new URLSearchParams([
|
||||||
['client_id', CLIENT_ID],
|
['client_id', CLIENT_ID],
|
||||||
['redirect_uri', REDIRECT_URL],
|
['redirect_uri', redirectUri],
|
||||||
['scope', scopes],
|
['scope', scopes],
|
||||||
['state', encodeURIComponent(callbackUri.toString(true))]
|
['state', encodeURIComponent(callbackUri.toString(true))]
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ import path = require('path');
|
|||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
// TODO: Change to stable when it's deployed.
|
const redirectUrl = 'https://vscode.dev/redirect';
|
||||||
const redirectUrl = 'https://insiders.vscode.dev/redirect';
|
|
||||||
const loginEndpointUrl = 'https://login.microsoftonline.com/';
|
const loginEndpointUrl = 'https://login.microsoftonline.com/';
|
||||||
const DEFAULT_CLIENT_ID = 'aebc6443-996d-45c2-90f0-388ff96faa56';
|
const DEFAULT_CLIENT_ID = 'aebc6443-996d-45c2-90f0-388ff96faa56';
|
||||||
const DEFAULT_TENANT = 'organizations';
|
const DEFAULT_TENANT = 'organizations';
|
||||||
|
|||||||
Reference in New Issue
Block a user