From 397912fccf3067204b9dcb63056c0d09b8d376ed Mon Sep 17 00:00:00 2001 From: Evan <91367930+evan-crash@users.noreply.github.com> Date: Thu, 31 Jul 2025 11:18:15 +0800 Subject: [PATCH] feat(foundation): remove max expiration days check of API Token (#351) --- .../studio/open-platform/open-auth/src/utils/time.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/frontend/packages/studio/open-platform/open-auth/src/utils/time.ts b/frontend/packages/studio/open-platform/open-auth/src/utils/time.ts index 2c112851..e7661296 100644 --- a/frontend/packages/studio/open-platform/open-auth/src/utils/time.ts +++ b/frontend/packages/studio/open-platform/open-auth/src/utils/time.ts @@ -13,21 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + import dayjs from 'dayjs'; import { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n'; -const MAX_EXPIRATION_DAYS = 30; -// 1-30 days valid period export const disabledDate = (date?: Date) => { const today = dayjs().startOf('day'); // Start time of the day - const thirtyDaysLater = today.add(MAX_EXPIRATION_DAYS, 'day'); // Date in 30 days - return ( - dayjs(date).isBefore(today, 'day') || - dayjs(date).isSame(today, 'day') || - dayjs(date).isAfter(thirtyDaysLater, 'day') - ); + return dayjs(date).isBefore(today, 'day') || dayjs(date).isSame(today, 'day'); }; export enum ExpirationDate {