diff --git a/packages/console/src/pages/CustomizeJwt/index.tsx b/packages/console/src/pages/CustomizeJwt/index.tsx index 169137b2e..5af3f753c 100644 --- a/packages/console/src/pages/CustomizeJwt/index.tsx +++ b/packages/console/src/pages/CustomizeJwt/index.tsx @@ -9,6 +9,7 @@ import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider'; import { TenantsContext } from '@/contexts/TenantsProvider'; import CardTitle from '@/ds-components/CardTitle'; import FormField from '@/ds-components/FormField'; +import useDocumentationUrl from '@/hooks/use-documentation-url'; import CreateButton from './CreateButton'; import CustomizerItem from './CustomizerItem'; @@ -25,6 +26,8 @@ function CustomizeJwt() { currentSubscription: { planId }, currentSubscriptionQuota: { customJwtEnabled }, } = useContext(SubscriptionDataContext); + + const { getDocumentationUrl } = useDocumentationUrl(); const isCustomJwtEnabled = !isCloud || customJwtEnabled; const showPaywall = planId === ReservedPlanId.Free; @@ -44,6 +47,10 @@ function CustomizeJwt() { paywall={cond((!isCustomJwtEnabled || isDevTenant) && ReservedPlanId.Pro)} title="jwt_claims.title" subtitle="jwt_claims.description" + learnMoreLink={{ + href: getDocumentationUrl('/docs/recipes/custom-jwt'), + targetBlank: 'noopener', + }} className={styles.header} /> diff --git a/packages/console/src/pages/CustomizeJwtDetails/utils/config.tsx b/packages/console/src/pages/CustomizeJwtDetails/utils/config.tsx index 5846682b4..e45d82a7b 100644 --- a/packages/console/src/pages/CustomizeJwtDetails/utils/config.tsx +++ b/packages/console/src/pages/CustomizeJwtDetails/utils/config.tsx @@ -104,7 +104,7 @@ declare type Payload = { };`; export const defaultAccessTokenJwtCustomizerCode = `/** - * This function is called during the access token generation process to get custom claims for the JWT token. + * This function is called during the access token generation process to get custom claims for the access token. * Limit custom claims to under 50KB. * * @param {Payload} payload - The input argument of the function. @@ -118,7 +118,7 @@ const getCustomJwtClaims = async ({ token, context, environmentVariables${ }`; export const defaultClientCredentialsJwtCustomizerCode = `/** - * This function is called during the access token generation process to get custom claims for the JWT token. + * This function is called during the access token generation process to get custom claims for the access token. * Limit custom claims to under 50KB. * * @param {Payload} payload - The input payload of the function. diff --git a/packages/phrases/src/locales/en/errors/jwt-customizer.ts b/packages/phrases/src/locales/en/errors/jwt-customizer.ts index 7f6421a63..aac60e5ae 100644 --- a/packages/phrases/src/locales/en/errors/jwt-customizer.ts +++ b/packages/phrases/src/locales/en/errors/jwt-customizer.ts @@ -1,6 +1,6 @@ const jwt_customizer = { - general: 'An error occurred while customizing the JWT token. Please try again later.', - can_not_create_for_admin_tenant: 'Cannot create a JWT token customizer for the admin tenant.', + general: 'An error occurred while customizing the token claims. Please try again later.', + can_not_create_for_admin_tenant: 'Cannot create a token customizer for the admin tenant.', }; export default Object.freeze(jwt_customizer); diff --git a/packages/phrases/src/locales/en/translation/admin-console/jwt-claims.ts b/packages/phrases/src/locales/en/translation/admin-console/jwt-claims.ts index 2bc6fdcf4..4d97d606a 100644 --- a/packages/phrases/src/locales/en/translation/admin-console/jwt-claims.ts +++ b/packages/phrases/src/locales/en/translation/admin-console/jwt-claims.ts @@ -1,7 +1,7 @@ const jwt_claims = { title: 'Custom JWT', description: - 'Set up custom JWT claims to include in the access token. These claims can be used to pass additional information to your application.', + 'Set up custom claims in the access token. These claims can be used to pass additional information to your application.', user_jwt: { card_title: 'For user', card_field: 'User access token', @@ -25,7 +25,7 @@ const jwt_claims = { restored: 'Restored', data_source_tab: 'Data source', test_tab: 'Test context', - jwt_claims_description: 'Default claims are auto-included in the JWT and cannot be overridden.', + jwt_claims_description: 'Default claims are auto-included in the and cannot be overridden.', user_data: { title: 'User context', subtitle: 'Use `context.user` input parameter to provide vital user info.', @@ -53,10 +53,10 @@ const jwt_claims = { title: 'Set environment variables', subtitle: 'Use environment variables to store sensitive information.', input_field_title: 'Add environment variables', - sample_code: 'Accessing environment variables in your custom JWT claims handler. Example: ', + sample_code: 'Accessing environment variables in your custom token claims handler. Example: ', }, jwt_claims_hint: - 'Limit custom claims to under 50KB. Default JWT claims are automatically included in the token and can not be overridden.', + 'Limit custom claims to under 50KB. Default token claims are automatically included in the token and can not be overridden.', tester: { subtitle: 'Adjust mock token and user data for testing.', run_button: 'Run test',