Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/perky-plums-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@clerk/localizations': patch
'@clerk/clerk-js': patch
'@clerk/shared': patch
'@clerk/ui': patch
---

Rename the `<OrganizationProfile />` SSO page to "Security". The navbar entry is now labeled "Security" with a shield icon, its route path changed from `organization-self-serve-sso` to `organization-security`, and a new `organizationProfile.navbar.security` localization key replaces `organizationProfile.navbar.selfServeSSO`.
2 changes: 1 addition & 1 deletion packages/localizations/src/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ export const enUS: LocalizationResource = {
navbar: {
apiKeys: 'API keys',
billing: 'Billing',
selfServeSSO: 'Single Sign-On (SSO)',
security: 'Security',
description: 'Manage your organization.',
general: 'General',
members: 'Members',
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/types/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ export type __internal_LocalizationResource = {
members: LocalizationValue;
billing: LocalizationValue;
apiKeys: LocalizationValue;
selfServeSSO: LocalizationValue;
security: LocalizationValue;
};
badge__unverified: LocalizationValue;
badge__automaticInvitation: LocalizationValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const OrganizationPaymentAttemptPage = lazy(() =>
})),
);

const OrganizationSelfServeSSOPage = lazy(() =>
import(/* webpackChunkName: "op-self-serve-sso-page"*/ './OrganizationSelfServeSSOPage').then(module => ({
default: module.OrganizationSelfServeSSOPage,
const OrganizationSecurityPage = lazy(() =>
import(/* webpackChunkName: "op-security-page"*/ './OrganizationSecurityPage').then(module => ({
default: module.OrganizationSecurityPage,
})),
);

Expand All @@ -54,7 +54,7 @@ export const OrganizationProfileRoutes = ({ contentRef }: OrganizationProfileRou
isGeneralPageRoot,
isBillingPageRoot,
isAPIKeysPageRoot,
isSelfServeSsoPageRoot,
isSecurityPageRoot,
shouldShowBilling,
shouldShowSelfServeSSO,
apiKeysProps,
Expand Down Expand Up @@ -155,11 +155,11 @@ export const OrganizationProfileRoutes = ({ contentRef }: OrganizationProfileRou
</Protect>
)}
{shouldShowSelfServeSSO ? (
<Route path={isSelfServeSsoPageRoot ? undefined : 'organization-self-serve-sso'}>
<Route path={isSecurityPageRoot ? undefined : 'organization-security'}>
<Switch>
<Route index>
<Suspense fallback={''}>
<OrganizationSelfServeSSOPage contentRef={contentRef} />
<OrganizationSecurityPage contentRef={contentRef} />
</Suspense>
</Route>
</Switch>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { useOrganization } from '@clerk/shared/react';

import { ConfigureSSOContent } from '../ConfigureSSO/ConfigureSSO';

type OrganizationSelfServeSSOPageProps = {
type OrganizationSecurityPageProps = {
contentRef: React.RefObject<HTMLDivElement>;
};

export const OrganizationSelfServeSSOPage = ({ contentRef }: OrganizationSelfServeSSOPageProps) => {
export const OrganizationSecurityPage = ({ contentRef }: OrganizationSecurityPageProps) => {
const { organization } = useOrganization();

if (!organization) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { bindCreateFixtures } from '@/test/create-fixtures';
import { cleanup, render, screen, waitFor } from '@/test/utils';

import { OrganizationProfile } from '../';
import { OrganizationSelfServeSSOPage } from '../OrganizationSelfServeSSOPage';
import { OrganizationSecurityPage } from '../OrganizationSecurityPage';

const { createFixtures } = bindCreateFixtures('OrganizationProfile');

Expand Down Expand Up @@ -495,7 +495,7 @@ describe('OrganizationProfile', () => {
});

render(<OrganizationProfile />, { wrapper });
expect(await screen.findByText('Single Sign-On (SSO)')).toBeDefined();
expect(await screen.findByText('Security')).toBeDefined();
});

it('does not include SSO when disabled at the instance level', async () => {
Expand All @@ -515,7 +515,7 @@ describe('OrganizationProfile', () => {
});

const { queryByText } = render(<OrganizationProfile />, { wrapper });
await waitFor(() => expect(queryByText('Single Sign-On (SSO)')).toBeNull());
await waitFor(() => expect(queryByText('Security')).toBeNull());
});

it('does not include SSO when the org has not opted in, even if the instance has it enabled', async () => {
Expand All @@ -535,7 +535,7 @@ describe('OrganizationProfile', () => {
});

const { queryByText } = render(<OrganizationProfile />, { wrapper });
await waitFor(() => expect(queryByText('Single Sign-On (SSO)')).toBeNull());
await waitFor(() => expect(queryByText('Security')).toBeNull());
});

it('includes SSO even when the user does not have the manage enterprise connections permission, but the page surfaces a warning', async () => {
Expand All @@ -557,10 +557,10 @@ describe('OrganizationProfile', () => {
fixtures.clerk.user?.getEnterpriseConnections.mockResolvedValue([]);

render(<OrganizationProfile />, { wrapper });
expect(await screen.findByText('Single Sign-On (SSO)')).toBeDefined();
expect(await screen.findByText('Security')).toBeDefined();

cleanup();
render(<OrganizationSelfServeSSOPage />, { wrapper });
render(<OrganizationSecurityPage />, { wrapper });
expect(await screen.findByText(/you do not have permission to manage single sign-on/i)).toBeDefined();
expect(
screen.queryByText(/contact your organization.*administrator to upgrade your permissions/i),
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID = {
MEMBERS: 'members',
BILLING: 'billing',
API_KEYS: 'apiKeys',
SELF_SERVE_SSO: 'selfServeSSO',
SECURITY: 'security',
};

export const USER_BUTTON_ITEM_ID = {
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/contexts/components/OrganizationProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type OrganizationProfileContextType = OrganizationProfileCtx & {
isGeneralPageRoot: boolean;
isBillingPageRoot: boolean;
isAPIKeysPageRoot: boolean;
isSelfServeSsoPageRoot: boolean;
isSecurityPageRoot: boolean;
shouldShowBilling: boolean;
shouldShowSelfServeSSO: boolean;
};
Expand Down Expand Up @@ -81,7 +81,7 @@ export const useOrganizationProfileContext = (): OrganizationProfileContextType
const isGeneralPageRoot = pages.routes[0].id === ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID.GENERAL;
const isBillingPageRoot = pages.routes[0].id === ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID.BILLING;
const isAPIKeysPageRoot = pages.routes[0].id === ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID.API_KEYS;
const isSelfServeSsoPageRoot = pages.routes[0].id === ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID.SELF_SERVE_SSO;
const isSecurityPageRoot = pages.routes[0].id === ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID.SECURITY;
const navigateToGeneralPageRoot = () =>
navigate(isGeneralPageRoot ? '../' : isMembersPageRoot ? './organization-general' : '../organization-general');

Expand All @@ -95,7 +95,7 @@ export const useOrganizationProfileContext = (): OrganizationProfileContextType
isGeneralPageRoot,
isBillingPageRoot,
isAPIKeysPageRoot,
isSelfServeSsoPageRoot,
isSecurityPageRoot,
shouldShowBilling,
shouldShowSelfServeSSO,
};
Expand Down
22 changes: 11 additions & 11 deletions packages/ui/src/utils/createCustomPages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { CustomPage, EnvironmentResource, LoadedClerk } from '@clerk/shared

import { ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID, USER_PROFILE_NAVBAR_ROUTE_ID } from '../constants';
import type { NavbarRoute } from '../elements/Navbar';
import { Building, Code, Connections, CreditCard, ShieldCheck, UserCircle, Users } from '../icons';
import { Building, Code, CreditCard, ShieldCheck, UserCircle, Users } from '../icons';
import { localizationKeys } from '../localization';
import { ExternalElementMounter } from './ExternalElementMounter';
import { isDevelopmentSDK } from './runtimeEnvironment';
Expand Down Expand Up @@ -52,11 +52,11 @@ type CreateCustomPagesParams = {
getDefaultRoutes: ({
commerce,
apiKeys,
selfServeSSO,
security,
}: {
commerce: boolean;
apiKeys: boolean;
selfServeSSO: boolean;
security: boolean;
}) => GetDefaultRoutesReturnType;
setFirstPathToRoot: (routes: NavbarRoute[]) => NavbarRoute[];
excludedPathsFromDuplicateWarning: string[];
Expand Down Expand Up @@ -118,7 +118,7 @@ const createCustomPages = (
apiKeys: organization
? !disabledOrganizationAPIKeysFeature(clerk, environment)
: !disabledUserAPIKeysFeature(clerk, environment),
selfServeSSO: organization ? shouldShowSelfServeSSO && !disabledSelfServeSSOFeature(clerk, environment) : false,
security: organization ? shouldShowSelfServeSSO && !disabledSelfServeSSOFeature(clerk, environment) : false,
});

if (isDevelopmentSDK(clerk)) {
Expand Down Expand Up @@ -328,11 +328,11 @@ const getUserProfileDefaultRoutes = ({
const getOrganizationProfileDefaultRoutes = ({
commerce,
apiKeys,
selfServeSSO,
security,
}: {
commerce: boolean;
apiKeys: boolean;
selfServeSSO: boolean;
security: boolean;
}): GetDefaultRoutesReturnType => {
const INITIAL_ROUTES: NavbarRoute[] = [
{
Expand Down Expand Up @@ -364,12 +364,12 @@ const getOrganizationProfileDefaultRoutes = ({
path: 'organization-api-keys',
});
}
if (selfServeSSO) {
if (security) {
INITIAL_ROUTES.push({
name: localizationKeys('organizationProfile.navbar.selfServeSSO'),
id: ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID.SELF_SERVE_SSO,
icon: Connections,
path: 'organization-self-serve-sso',
name: localizationKeys('organizationProfile.navbar.security'),
id: ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID.SECURITY,
icon: ShieldCheck,
path: 'organization-security',
});
}

Expand Down
Loading