Skip to content

Commit d1ce0eb

Browse files
committed
Revert "Get authentication session info from workbench html in dev mode"
This reverts commit 2e8152c.
1 parent 5f0a1f3 commit d1ce0eb

2 files changed

Lines changed: 12 additions & 39 deletions

File tree

src/vs/code/browser/workbench/workbench-dev.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
<!-- Workbench Configuration -->
1515
<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONFIGURATION}}">
1616

17-
<!-- running out of sources -->
18-
<!-- Builtin Extensions -->
17+
<!-- Builtin Extensions (running out of sources) -->
1918
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
20-
<!-- Authentication Session Info -->
21-
<meta id="vscode-workbench-authentication-session" data-settings="{{WORKBENCH_AUTHENTICATION_SESSION}}">
2219

2320
<!-- Workarounds/Hacks (remote user data uri) -->
2421
<meta id="vscode-remote-user-data-uri" data-settings="{{REMOTE_USER_DATA_URI}}">

src/vs/workbench/services/userData/browser/userDataInit.ts

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
1919
import { IRequestService } from 'vs/platform/request/common/request';
2020
import { CONFIGURATION_SYNC_STORE_KEY, IUserDataSyncStoreClient, SyncResource } from 'vs/platform/userDataSync/common/userDataSync';
2121
import { URI } from 'vs/base/common/uri';
22-
import { AuthenticationSessionInfo, getCurrentAuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService';
22+
import { getCurrentAuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService';
2323
import { getSyncAreaLabel } from 'vs/workbench/services/userDataSync/common/userDataSync';
2424
import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions } from 'vs/workbench/common/contributions';
2525
import { Registry } from 'vs/platform/registry/common/platform';
@@ -80,13 +80,18 @@ export class UserDataInitializationService implements IUserDataInitializationSer
8080
return;
8181
}
8282

83-
const authenticationSession = await this.getCurrentAuthenticationSessionInfo();
83+
if (!this.environmentService.options?.credentialsProvider) {
84+
this.logService.trace(`Skipping initializing user data as credentials provider is not provided`);
85+
return;
86+
}
8487

88+
let authenticationSession;
89+
try {
90+
authenticationSession = await getCurrentAuthenticationSessionInfo(this.environmentService, this.productService);
91+
} catch (error) {
92+
this.logService.error(error);
93+
}
8594
if (!authenticationSession) {
86-
if (!this.environmentService.options?.credentialsProvider) {
87-
this.logService.trace(`Skipping initializing user data as credentials provider is not provided`);
88-
return;
89-
}
9095
this.logService.trace(`Skipping initializing user data as authentication session is not set`);
9196
return;
9297
}
@@ -100,35 +105,6 @@ export class UserDataInitializationService implements IUserDataInitializationSer
100105
return this._userDataSyncStoreClientPromise;
101106
}
102107

103-
private async getCurrentAuthenticationSessionInfo(): Promise<AuthenticationSessionInfo | undefined> {
104-
if (this.environmentService.options?.credentialsProvider) {
105-
try {
106-
const currentAuthenticationSessionInfo = await getCurrentAuthenticationSessionInfo(this.environmentService, this.productService);
107-
if (currentAuthenticationSessionInfo) {
108-
return currentAuthenticationSessionInfo;
109-
}
110-
} catch (error) {
111-
this.logService.error(error);
112-
return undefined;
113-
}
114-
}
115-
116-
if (!this.environmentService.isBuilt) {
117-
const authenticationSessionInfoElement = document.getElementById('vscode-workbench-authentication-session');
118-
const authenticationSessionInfoElementAttribute = authenticationSessionInfoElement ? authenticationSessionInfoElement.getAttribute('data-settings') : undefined;
119-
if (authenticationSessionInfoElementAttribute) {
120-
try {
121-
return JSON.parse(authenticationSessionInfoElementAttribute);
122-
} catch (error) {
123-
this.logService.error(error);
124-
return undefined;
125-
}
126-
}
127-
}
128-
129-
return undefined;
130-
}
131-
132108
async initializeRequiredResources(): Promise<void> {
133109
return this.initialize([SyncResource.Settings, SyncResource.GlobalState]);
134110
}

0 commit comments

Comments
 (0)