Skip to content

Commit 7540857

Browse files
allow disconnect for org owned users (#18221)
1 parent 79328a1 commit 7540857

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

components/dashboard/src/user-settings/Integrations.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See License.AGPL.txt in the project root for license information.
55
*/
66

7-
import { AuthProviderEntry, AuthProviderInfo } from "@gitpod/gitpod-protocol";
7+
import { AuthProviderEntry, AuthProviderInfo, User } from "@gitpod/gitpod-protocol";
88
import { SelectAccountPayload } from "@gitpod/gitpod-protocol/lib/auth";
99
import { useQuery } from "@tanstack/react-query";
1010
import React, { useCallback, useContext, useEffect, useState } from "react";
@@ -98,10 +98,12 @@ function GitProviders() {
9898
separator: true,
9999
});
100100
}
101-
const connectedWithSecondProvider = authProviders.data?.some(
102-
(p) => p.authProviderId !== provider.authProviderId && isConnected(p.authProviderId),
103-
);
104-
if (connectedWithSecondProvider) {
101+
const canDisconnect =
102+
(user && User.isOrganizationOwned(user)) ||
103+
authProviders.data?.some(
104+
(p) => p.authProviderId !== provider.authProviderId && isConnected(p.authProviderId),
105+
);
106+
if (canDisconnect) {
105107
result.push({
106108
title: "Disconnect",
107109
customFontStyle: "text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300",

0 commit comments

Comments
 (0)