Skip to content

Commit

Permalink
SLVSCODE-834 store SonarCloud tokens properly
Browse files Browse the repository at this point in the history
  • Loading branch information
sophio-japharidze-sonarsource committed Aug 22, 2024
1 parent aceb7ec commit c5a3597
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/connected/connectionsetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,22 @@ export function confirmConnectionDetailsAndSave(context: vscode.ExtensionContext
if (reply.confirmed) {
if (isSonarCloud) {
const sonarCloudToken = token || await ConnectionSettingsService.instance.getServerToken(serverUrlOrOrganizationKey);
const connection = {
sonarCloudToken,
const connection : SonarCloudConnection = {
token: sonarCloudToken,
connectionId: serverUrlOrOrganizationKey,
disableNotifications: false,
organizationKey: serverUrlOrOrganizationKey
} as SonarCloudConnection;
};

return await ConnectionSettingsService.instance.addSonarCloudConnection(connection);
} else if (!isSonarCloud && token) {
// new flow for SonarQube
const connection = {
const connection : SonarQubeConnection = {
token,
connectionId: serverUrlOrOrganizationKey,
disableNotifications: false,
serverUrl: serverUrlOrOrganizationKey
} as SonarQubeConnection;
};
return await ConnectionSettingsService.instance.addSonarQubeConnection(connection);
} else {
// old flow for SonarQube
Expand Down

0 comments on commit c5a3597

Please sign in to comment.