use auth session id for sync when enabled by embedder (#180444)

This commit is contained in:
Sandeep Somavarapu 2023-04-21 00:19:45 +02:00 committed by GitHub
parent cedf1eaa25
commit 155d71f27d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,9 +168,16 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
private async initialize(): Promise<void> {
const authenticationSession = await getCurrentAuthenticationSessionInfo(this.credentialsService, this.productService);
if (this.currentSessionId === undefined && this.useWorkbenchSessionId && authenticationSession?.id) {
this.currentSessionId = authenticationSession?.id;
this.useWorkbenchSessionId = !!this.environmentService.options?.settingsSyncOptions?.enabled;
if (this.currentSessionId === undefined && authenticationSession?.id) {
if (this.environmentService.options?.settingsSyncOptions?.authenticationProvider && this.environmentService.options.settingsSyncOptions.enabled) {
this.currentSessionId = authenticationSession?.id;
}
// Backward compatibility
else if (this.useWorkbenchSessionId) {
this.currentSessionId = authenticationSession?.id;
}
this.useWorkbenchSessionId = false;
}
await this.update();