From ff6b304bacb726c0a1604c3fa36340b716d0694a Mon Sep 17 00:00:00 2001 From: Darcy Ye Date: Tue, 13 Aug 2024 19:16:43 +0800 Subject: [PATCH] fix(console): should not block custom JWT creation for OSS user (#6441) --- .changeset/friendly-rice-sell.md | 5 +++++ .../src/pages/CustomizeJwt/CreateButton/index.tsx | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .changeset/friendly-rice-sell.md diff --git a/.changeset/friendly-rice-sell.md b/.changeset/friendly-rice-sell.md new file mode 100644 index 000000000..6f5e862c7 --- /dev/null +++ b/.changeset/friendly-rice-sell.md @@ -0,0 +1,5 @@ +--- +"@logto/console": patch +--- + +fix: should not show custom JWT paywall for OSS users diff --git a/packages/console/src/pages/CustomizeJwt/CreateButton/index.tsx b/packages/console/src/pages/CustomizeJwt/CreateButton/index.tsx index 0d4d2c5cd..6cb77be4c 100644 --- a/packages/console/src/pages/CustomizeJwt/CreateButton/index.tsx +++ b/packages/console/src/pages/CustomizeJwt/CreateButton/index.tsx @@ -3,7 +3,7 @@ import { useCallback, useContext } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import ContactUsPhraseLink from '@/components/ContactUsPhraseLink'; -import { isDevFeaturesEnabled } from '@/consts/env'; +import { isCloud, isDevFeaturesEnabled } from '@/consts/env'; import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider'; import Button from '@/ds-components/Button'; import { useConfirmModal } from '@/hooks/use-confirm-modal'; @@ -23,9 +23,11 @@ function CreateButton({ isDisabled, tokenType }: Props) { const { currentPlan, currentSubscriptionQuota } = useContext(SubscriptionDataContext); - const isCustomJwtEnabled = isDevFeaturesEnabled - ? currentSubscriptionQuota.customJwtEnabled - : currentPlan.quota.customJwtEnabled; + const isCustomJwtEnabled = + !isCloud || + (isDevFeaturesEnabled + ? currentSubscriptionQuota.customJwtEnabled + : currentPlan.quota.customJwtEnabled); const onCreateButtonClick = useCallback(async () => { if (isCustomJwtEnabled) {