0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(console): should not block custom JWT creation for OSS user (#6441)

This commit is contained in:
Darcy Ye 2024-08-13 19:16:43 +08:00 committed by GitHub
parent 6a809e1307
commit ff6b304bac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -0,0 +1,5 @@
---
"@logto/console": patch
---
fix: should not show custom JWT paywall for OSS users

View file

@ -3,7 +3,7 @@ import { useCallback, useContext } from 'react';
import { Trans, useTranslation } from 'react-i18next'; import { Trans, useTranslation } from 'react-i18next';
import ContactUsPhraseLink from '@/components/ContactUsPhraseLink'; import ContactUsPhraseLink from '@/components/ContactUsPhraseLink';
import { isDevFeaturesEnabled } from '@/consts/env'; import { isCloud, isDevFeaturesEnabled } from '@/consts/env';
import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider'; import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider';
import Button from '@/ds-components/Button'; import Button from '@/ds-components/Button';
import { useConfirmModal } from '@/hooks/use-confirm-modal'; import { useConfirmModal } from '@/hooks/use-confirm-modal';
@ -23,9 +23,11 @@ function CreateButton({ isDisabled, tokenType }: Props) {
const { currentPlan, currentSubscriptionQuota } = useContext(SubscriptionDataContext); const { currentPlan, currentSubscriptionQuota } = useContext(SubscriptionDataContext);
const isCustomJwtEnabled = isDevFeaturesEnabled const isCustomJwtEnabled =
!isCloud ||
(isDevFeaturesEnabled
? currentSubscriptionQuota.customJwtEnabled ? currentSubscriptionQuota.customJwtEnabled
: currentPlan.quota.customJwtEnabled; : currentPlan.quota.customJwtEnabled);
const onCreateButtonClick = useCallback(async () => { const onCreateButtonClick = useCallback(async () => {
if (isCustomJwtEnabled) { if (isCustomJwtEnabled) {