From b44068c8440101891b1e5aa3a81e2dbc023f940d Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Thu, 10 Aug 2023 14:50:38 +0800 Subject: [PATCH] chore: fix typo and lint --- .changeset/smooth-radios-wink.md | 2 +- .../components/AdvancedSettings.tsx | 35 ++++++++++--------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.changeset/smooth-radios-wink.md b/.changeset/smooth-radios-wink.md index 25b542351..c2e7ba10b 100644 --- a/.changeset/smooth-radios-wink.md +++ b/.changeset/smooth-radios-wink.md @@ -2,7 +2,7 @@ "@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; - Web public applications (i.e. SPA) with refresh token rotation enabled are not allowed to set refresh token TTL. diff --git a/packages/console/src/pages/ApplicationDetails/components/AdvancedSettings.tsx b/packages/console/src/pages/ApplicationDetails/components/AdvancedSettings.tsx index e2235c39e..48f88ee13 100644 --- a/packages/console/src/pages/ApplicationDetails/components/AdvancedSettings.tsx +++ b/packages/console/src/pages/ApplicationDetails/components/AdvancedSettings.tsx @@ -122,12 +122,14 @@ function AdvancedSettings({ applicationType, oidcConfig }: Props) { )} {/** - * Public clients (authentication method is none) are not allowed to disable refresh token - * rotation, so we don't show the option here. - * - * @see rotateRefreshToken() in `packages/core/src/oidc/default.ts` for more details. - */} - {[ApplicationType.Traditional, ApplicationType.MachineToMachine].includes(applicationType) && ( + * Public clients (authentication method is none) are not allowed to disable refresh token + * rotation, so we don't show the option here. + * + * @see rotateRefreshToken() in `packages/core/src/oidc/default.ts` for more details. + */} + {[ApplicationType.Traditional, ApplicationType.MachineToMachine].includes( + applicationType + ) && ( - )} + + )} {/** - * 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. - * - * @see refreshTokenTtl() in `packages/core/src/oidc/default.ts` for more details. - */} - {applicationType !== ApplicationType.SPA && + * 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. + * + * @see refreshTokenTtl() in `packages/core/src/oidc/default.ts` for more details. + */} + {applicationType !== ApplicationType.SPA && ( - value === undefined || - Number.isInteger(value) || - t('errors.should_be_an_integer'), + value === undefined || Number.isInteger(value) || t('errors.should_be_an_integer'), })} placeholder="14" // Confirm if we need a customized message here error={errors.customClientMetadata?.refreshTokenTtlInDays?.message} /> - } + )} {applicationType === ApplicationType.MachineToMachine && (