mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
chore: fix typo and lint
This commit is contained in:
parent
419fb3c91d
commit
b44068c844
2 changed files with 19 additions and 18 deletions
|
@ -2,7 +2,7 @@
|
||||||
"@logto/console": patch
|
"@logto/console": patch
|
||||||
---
|
---
|
||||||
|
|
||||||
fix display logic for "Always issue refresh token" and "Refresh token TTL" according to OIDC configuration
|
fix display logic for "Rotate refresh token" and "Refresh token TTL" according to OIDC configuration
|
||||||
|
|
||||||
- Public clients (authentication method is none) are not allowed to disable refresh token rotation;
|
- Public clients (authentication method is none) are not allowed to disable refresh token rotation;
|
||||||
- Web public applications (i.e. SPA) with refresh token rotation enabled are not allowed to set refresh token TTL.
|
- Web public applications (i.e. SPA) with refresh token rotation enabled are not allowed to set refresh token TTL.
|
||||||
|
|
|
@ -122,12 +122,14 @@ function AdvancedSettings({ applicationType, oidcConfig }: Props) {
|
||||||
</FormField>
|
</FormField>
|
||||||
)}
|
)}
|
||||||
{/**
|
{/**
|
||||||
* Public clients (authentication method is none) are not allowed to disable refresh token
|
* Public clients (authentication method is none) are not allowed to disable refresh token
|
||||||
* rotation, so we don't show the option here.
|
* rotation, so we don't show the option here.
|
||||||
*
|
*
|
||||||
* @see rotateRefreshToken() in `packages/core/src/oidc/default.ts` for more details.
|
* @see rotateRefreshToken() in `packages/core/src/oidc/default.ts` for more details.
|
||||||
*/}
|
*/}
|
||||||
{[ApplicationType.Traditional, ApplicationType.MachineToMachine].includes(applicationType) && (
|
{[ApplicationType.Traditional, ApplicationType.MachineToMachine].includes(
|
||||||
|
applicationType
|
||||||
|
) && (
|
||||||
<FormField title="application_details.rotate_refresh_token">
|
<FormField title="application_details.rotate_refresh_token">
|
||||||
<Switch
|
<Switch
|
||||||
label={
|
label={
|
||||||
|
@ -146,14 +148,15 @@ function AdvancedSettings({ applicationType, oidcConfig }: Props) {
|
||||||
}
|
}
|
||||||
{...register('customClientMetadata.rotateRefreshToken')}
|
{...register('customClientMetadata.rotateRefreshToken')}
|
||||||
/>
|
/>
|
||||||
</FormField>)}
|
</FormField>
|
||||||
|
)}
|
||||||
{/**
|
{/**
|
||||||
* Web public applications (i.e. SPA) with refresh token rotation enabled are not allowed
|
* Web public applications (i.e. SPA) with refresh token rotation enabled are not allowed
|
||||||
* to set refresh token TTL, so we don't show the option here.
|
* to set refresh token TTL, so we don't show the option here.
|
||||||
*
|
*
|
||||||
* @see refreshTokenTtl() in `packages/core/src/oidc/default.ts` for more details.
|
* @see refreshTokenTtl() in `packages/core/src/oidc/default.ts` for more details.
|
||||||
*/}
|
*/}
|
||||||
{applicationType !== ApplicationType.SPA &&
|
{applicationType !== ApplicationType.SPA && (
|
||||||
<FormField
|
<FormField
|
||||||
title="application_details.refresh_token_ttl"
|
title="application_details.refresh_token_ttl"
|
||||||
tip={t('application_details.refresh_token_ttl_tip')}
|
tip={t('application_details.refresh_token_ttl_tip')}
|
||||||
|
@ -170,16 +173,14 @@ function AdvancedSettings({ applicationType, oidcConfig }: Props) {
|
||||||
},
|
},
|
||||||
valueAsNumber: true,
|
valueAsNumber: true,
|
||||||
validate: (value) =>
|
validate: (value) =>
|
||||||
value === undefined ||
|
value === undefined || Number.isInteger(value) || t('errors.should_be_an_integer'),
|
||||||
Number.isInteger(value) ||
|
|
||||||
t('errors.should_be_an_integer'),
|
|
||||||
})}
|
})}
|
||||||
placeholder="14"
|
placeholder="14"
|
||||||
// Confirm if we need a customized message here
|
// Confirm if we need a customized message here
|
||||||
error={errors.customClientMetadata?.refreshTokenTtlInDays?.message}
|
error={errors.customClientMetadata?.refreshTokenTtlInDays?.message}
|
||||||
/>
|
/>
|
||||||
</FormField>
|
</FormField>
|
||||||
}
|
)}
|
||||||
{applicationType === ApplicationType.MachineToMachine && (
|
{applicationType === ApplicationType.MachineToMachine && (
|
||||||
<FormField title="application_details.enable_admin_access">
|
<FormField title="application_details.enable_admin_access">
|
||||||
<Switch
|
<Switch
|
||||||
|
|
Loading…
Reference in a new issue