diff --git a/src/vs/code/browser/workbench/workbench-dev.html b/src/vs/code/browser/workbench/workbench-dev.html
index aeb8c5e1e66..55ae7a39871 100644
--- a/src/vs/code/browser/workbench/workbench-dev.html
+++ b/src/vs/code/browser/workbench/workbench-dev.html
@@ -14,11 +14,8 @@
-
-
+
-
-
diff --git a/src/vs/workbench/services/userData/browser/userDataInit.ts b/src/vs/workbench/services/userData/browser/userDataInit.ts
index 569affa26a9..d3fc176f380 100644
--- a/src/vs/workbench/services/userData/browser/userDataInit.ts
+++ b/src/vs/workbench/services/userData/browser/userDataInit.ts
@@ -19,7 +19,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
import { IRequestService } from 'vs/platform/request/common/request';
import { CONFIGURATION_SYNC_STORE_KEY, IUserDataSyncStoreClient, SyncResource } from 'vs/platform/userDataSync/common/userDataSync';
import { URI } from 'vs/base/common/uri';
-import { AuthenticationSessionInfo, getCurrentAuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService';
+import { getCurrentAuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService';
import { getSyncAreaLabel } from 'vs/workbench/services/userDataSync/common/userDataSync';
import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions } from 'vs/workbench/common/contributions';
import { Registry } from 'vs/platform/registry/common/platform';
@@ -80,13 +80,18 @@ export class UserDataInitializationService implements IUserDataInitializationSer
return;
}
- const authenticationSession = await this.getCurrentAuthenticationSessionInfo();
+ if (!this.environmentService.options?.credentialsProvider) {
+ this.logService.trace(`Skipping initializing user data as credentials provider is not provided`);
+ return;
+ }
+ let authenticationSession;
+ try {
+ authenticationSession = await getCurrentAuthenticationSessionInfo(this.environmentService, this.productService);
+ } catch (error) {
+ this.logService.error(error);
+ }
if (!authenticationSession) {
- if (!this.environmentService.options?.credentialsProvider) {
- this.logService.trace(`Skipping initializing user data as credentials provider is not provided`);
- return;
- }
this.logService.trace(`Skipping initializing user data as authentication session is not set`);
return;
}
@@ -100,35 +105,6 @@ export class UserDataInitializationService implements IUserDataInitializationSer
return this._userDataSyncStoreClientPromise;
}
- private async getCurrentAuthenticationSessionInfo(): Promise {
- if (this.environmentService.options?.credentialsProvider) {
- try {
- const currentAuthenticationSessionInfo = await getCurrentAuthenticationSessionInfo(this.environmentService, this.productService);
- if (currentAuthenticationSessionInfo) {
- return currentAuthenticationSessionInfo;
- }
- } catch (error) {
- this.logService.error(error);
- return undefined;
- }
- }
-
- if (!this.environmentService.isBuilt) {
- const authenticationSessionInfoElement = document.getElementById('vscode-workbench-authentication-session');
- const authenticationSessionInfoElementAttribute = authenticationSessionInfoElement ? authenticationSessionInfoElement.getAttribute('data-settings') : undefined;
- if (authenticationSessionInfoElementAttribute) {
- try {
- return JSON.parse(authenticationSessionInfoElementAttribute);
- } catch (error) {
- this.logService.error(error);
- return undefined;
- }
- }
- }
-
- return undefined;
- }
-
async initializeRequiredResources(): Promise {
return this.initialize([SyncResource.Settings, SyncResource.GlobalState]);
}