Skip to content

Commit

Permalink
Send access token instead of id token
Browse files Browse the repository at this point in the history
Now that we ask for the SettingsSync scope, we can switch to using the access token with the explicit permission to ReadWrite Settings Sync.

Needs deployment of Settings Sync before we merge it in.
  • Loading branch information
TylerLeonhardt committed Sep 19, 2024
1 parent 17752c8 commit bfe76ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes
const existingSession = await this.getExistingSession();
if (existingSession) {
this.logService.info(`Found existing authentication session with ID ${existingSession.session.id}`);
return { sessionId: existingSession.session.id, token: existingSession.session.idToken ?? existingSession.session.accessToken, providerId: existingSession.session.providerId };
return { sessionId: existingSession.session.id, token: existingSession.session.accessToken, providerId: existingSession.session.providerId };
} else {
this._didSignOut.fire();
}
Expand All @@ -296,7 +296,7 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes
const authenticationSession = await this.getAccountPreference(reason);
if (authenticationSession !== undefined) {
this.existingSessionId = authenticationSession.id;
return { sessionId: authenticationSession.id, token: authenticationSession.idToken ?? authenticationSession.accessToken, providerId: authenticationSession.providerId };
return { sessionId: authenticationSession.id, token: authenticationSession.accessToken, providerId: authenticationSession.providerId };
}

return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class UserDataSyncAccount implements IUserDataSyncAccount {
get sessionId(): string { return this.session.id; }
get accountName(): string { return this.session.account.label; }
get accountId(): string { return this.session.account.id; }
get token(): string { return this.session.idToken || this.session.accessToken; }
get token(): string { return this.session.accessToken; }
}

type MergeEditorInput = { base: URI; input1: { uri: URI }; input2: { uri: URI }; result: URI };
Expand Down

0 comments on commit bfe76ec

Please sign in to comment.