Skip to content

Commit 3e475a1

Browse files
Adds token exchange route to cloud integrations manage/connect flows
1 parent ee9ceb8 commit 3e475a1

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
4242
- Fixes [#3377](https://github.com/gitkraken/vscode-gitlens/issues/3378) - Deleting a worktree (without force) with working changes causes double prompts
4343
- Fixes fixes issue with Jira integration not refreshing
4444
- Fixes the _Learn More_ link not working in the account verification dialog
45-
- Upgrading to Pro and account management now no longer require the user to log in again in their respective pages on _gitkraken.dev_
45+
- Upgrading to Pro, managing a GitKraken account, and managing or connecting cloud integrations now no longer require the user to log in again in their respective pages on _gitkraken.dev_
4646
- Fixes deep links failing to cancel in the remote add stage
4747

4848
## [15.1.0] - 2024-06-05

src/plus/integrations/integrationService.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import { configuration } from '../../system/configuration';
1111
import { debug, log } from '../../system/decorators/log';
1212
import { take } from '../../system/event';
1313
import { filterMap, flatten } from '../../system/iterable';
14+
import { Logger } from '../../system/logger';
15+
import { getLogScope } from '../../system/logger.scope';
16+
import { openUrl } from '../../system/utils';
1417
import type { SubscriptionChangeEvent } from '../gk/account/subscriptionService';
1518
import type { IntegrationAuthenticationService } from './authentication/integrationAuthentication';
1619
import type { SupportedCloudIntegrationIds } from './authentication/models';
@@ -112,6 +115,7 @@ export class IntegrationService implements Disposable {
112115
connect: { integrationId: SupportedCloudIntegrationIds; skipIfConnected?: boolean } | undefined,
113116
source: Source | undefined,
114117
) {
118+
const scope = getLogScope();
115119
const integrationId = connect?.integrationId;
116120
if (this.container.telemetry.enabled) {
117121
this.container.telemetry.sendEvent(
@@ -138,7 +142,15 @@ export class IntegrationService implements Disposable {
138142
query += `&connect=${integrationId}`;
139143
}
140144

141-
await env.openExternal(this.container.getGkDevUri('settings/integrations', query));
145+
try {
146+
const exchangeToken = await this.container.accountAuthentication.getExchangeToken();
147+
await openUrl(
148+
this.container.getGkDevExchangeUri(exchangeToken, `settings/integrations?${query}`).toString(true),
149+
);
150+
} catch (ex) {
151+
Logger.error(ex, scope);
152+
await env.openExternal(this.container.getGkDevUri('settings/integrations', query));
153+
}
142154
take(
143155
window.onDidChangeWindowState,
144156
2,

0 commit comments

Comments
 (0)