Use device flow over PAT when we are running in a server full environment but not in a supported uri (#139255)

* initial attempt

* use github-authentication instead

* rework error handling

* update copy

* explain why Workspace
This commit is contained in:
Tyler James Leonhardt
2021-12-15 22:07:49 -05:00
committed by GitHub
parent e7b3724e0c
commit f67a8b753f
4 changed files with 131 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Uri } from 'vscode';
const VALID_DESKTOP_CALLBACK_SCHEMES = [
'vscode',
'vscode-insiders',
'code-oss',
'vscode-wsl',
'vscode-exploration'
];
// This comes from the GitHub Authentication server
export function isSupportedEnvironment(url: Uri): boolean {
return VALID_DESKTOP_CALLBACK_SCHEMES.includes(url.scheme) || url.authority.endsWith('vscode.dev') || url.authority.endsWith('github.dev');
}