Path: blob/main/extensions/microsoft-authentication/src/common/env.ts
3320 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/4import { Uri } from 'vscode';56export const DEFAULT_REDIRECT_URI = 'https://vscode.dev/redirect';78const VALID_DESKTOP_CALLBACK_SCHEMES = [9'vscode',10'vscode-insiders',11// On Windows, some browsers don't seem to redirect back to OSS properly.12// As a result, you get stuck in the auth flow. We exclude this from the13// list until we can figure out a way to fix this behavior in browsers.14// 'code-oss',15'vscode-wsl',16'vscode-exploration'17];1819export function isSupportedClient(uri: Uri): boolean {20return (21VALID_DESKTOP_CALLBACK_SCHEMES.includes(uri.scheme) ||22// vscode.dev & insiders.vscode.dev23/(?:^|\.)vscode\.dev$/.test(uri.authority) ||24// github.dev & codespaces25/(?:^|\.)github\.dev$/.test(uri.authority) ||26// localhost27/^localhost:\d+$/.test(uri.authority) ||28// 127.0.0.129/^127\.0\.0\.1:\d+$/.test(uri.authority)30);31}323334