From 9907fb25f42879a10bc81ef42d5a0471044d065a Mon Sep 17 00:00:00 2001 From: Chris Stockton <180184+cstockton@users.noreply.github.com> Date: Tue, 16 Sep 2025 09:20:33 -0700 Subject: [PATCH 01/11] fix(ui/auth-sessions): always show refresh token reuse interval (#38723) * fix(ui/auth-sessions): always show refresh token reuse interval The reuse interval input was previously hidden when rotation was disabled. This caused confusion, since the interval still applies regardless of rotation setting. Allow zero values for reuse interval as it is supported in auth server and is used by some projects. * Always render SECURITY_REFRESH_TOKEN_REUSE_INTERVAL field. * Removed .positive() schema check to allow 0 values * Improves alignment between dashboard UI and backend behavior * chore: prettier --------- Co-authored-by: Chris Stockton --- .../SessionsAuthSettingsForm.tsx | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/apps/studio/components/interfaces/Auth/SessionsAuthSettingsForm/SessionsAuthSettingsForm.tsx b/apps/studio/components/interfaces/Auth/SessionsAuthSettingsForm/SessionsAuthSettingsForm.tsx index 7ae7a7cc95825..3cea989af221f 100644 --- a/apps/studio/components/interfaces/Auth/SessionsAuthSettingsForm/SessionsAuthSettingsForm.tsx +++ b/apps/studio/components/interfaces/Auth/SessionsAuthSettingsForm/SessionsAuthSettingsForm.tsx @@ -44,10 +44,7 @@ function HoursOrNeverText({ value }: { value: number }) { const RefreshTokenSchema = z.object({ REFRESH_TOKEN_ROTATION_ENABLED: z.boolean(), - SECURITY_REFRESH_TOKEN_REUSE_INTERVAL: z.coerce - .number() - .positive() - .min(0, 'Must be a value more than 0'), + SECURITY_REFRESH_TOKEN_REUSE_INTERVAL: z.coerce.number().min(0, 'Must be a value more than 0'), }) const UserSessionsSchema = z.object({ @@ -202,32 +199,30 @@ export const SessionsAuthSettingsForm = () => { )} /> - {refreshTokenForm.watch('REFRESH_TOKEN_ROTATION_ENABLED') && ( - - ( - - - - - - - - )} - /> - - )} + + ( + + + + + + + + )} + /> + {refreshTokenForm.formState.isDirty && (