mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
chore(console,phrases): update custom JWT phrases (#6551)
* chore(console,phrases): update cusotm jwt phrases update custom jwt phrase in console * chore(console): update the comments update the comments
This commit is contained in:
parent
baa8577c45
commit
5f3c0691b5
4 changed files with 15 additions and 8 deletions
|
@ -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}
|
||||
/>
|
||||
<UpsellNotice isVisible={showPaywall} className={styles.inlineNotice} />
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue