mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
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:
committed by
GitHub
parent
e7b3724e0c
commit
f67a8b753f
@@ -43,7 +43,11 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
|
||||
this._telemetryReporter = new ExperimentationTelemetry(context, new TelemetryReporter(name, version, aiKey));
|
||||
|
||||
if (this.type === AuthProviderType.github) {
|
||||
this._githubServer = new GitHubServer(this._logger, this._telemetryReporter);
|
||||
this._githubServer = new GitHubServer(
|
||||
// We only can use the Device Code flow when we are running with a remote extension host.
|
||||
context.extension.extensionKind === vscode.ExtensionKind.Workspace,
|
||||
this._logger,
|
||||
this._telemetryReporter);
|
||||
} else {
|
||||
this._githubServer = new GitHubEnterpriseServer(this._logger, this._telemetryReporter);
|
||||
}
|
||||
@@ -216,7 +220,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
|
||||
return session;
|
||||
} catch (e) {
|
||||
// If login was cancelled, do not notify user.
|
||||
if (e === 'Cancelled') {
|
||||
if (e === 'Cancelled' || e.message === 'Cancelled') {
|
||||
/* __GDPR__
|
||||
"loginCancelled" : { }
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user