From db4c22cf6af1467678993b269981169b5b8892d9 Mon Sep 17 00:00:00 2001 From: hiroasano Date: Wed, 11 Sep 2024 11:35:29 +0200 Subject: [PATCH] Fix reroll key when selecting "now" as expiration time --- .../[apiId]/keys/[keyAuthId]/[keyId]/settings/reroll-key.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/reroll-key.tsx b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/reroll-key.tsx index af29508de0..fa34c5986a 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/reroll-key.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/reroll-key.tsx @@ -123,7 +123,7 @@ export const RerollKey: React.FC = ({ apiKey, apiId, lastUsed }: Props) = await updateNewKey.mutateAsync({ roleId: role.roleId, keyId: newKey.keyId }); }); - const miliseconds = ms(values.expiresIn); + const miliseconds = values.expiresIn === "now" ? 0 : ms(values.expiresIn); const deletedAt = new Date(Date.now() + miliseconds); await updateDeletedAt.mutate({