diff --git a/web/src/components/CreateAccessTokenDialog.tsx b/web/src/components/CreateAccessTokenDialog.tsx index e1233818..a36e96fe 100644 --- a/web/src/components/CreateAccessTokenDialog.tsx +++ b/web/src/components/CreateAccessTokenDialog.tsx @@ -30,13 +30,17 @@ function CreateAccessTokenDialog({ open, onOpenChange, onSuccess }: Props) { const currentUser = useCurrentUser(); const [state, setState] = useState({ description: "", - expiration: 30, // Default: 30 days + expiration: 0, // Default: never expires }); const [createdToken, setCreatedToken] = useState(null); const requestState = useLoading(false); // Expiration options in days (0 = never expires) const expirationOptions = [ + { + label: t("setting.access-token.create-dialog.duration-never"), + value: 0, + }, { label: t("setting.access-token.create-dialog.duration-1m"), value: 30, @@ -45,10 +49,6 @@ function CreateAccessTokenDialog({ open, onOpenChange, onSuccess }: Props) { label: t("setting.access-token.create-dialog.duration-90d"), value: 90, }, - { - label: t("setting.access-token.create-dialog.duration-never"), - value: 0, - }, ]; const setPartialState = (partialState: Partial) => { @@ -109,7 +109,7 @@ function CreateAccessTokenDialog({ open, onOpenChange, onSuccess }: Props) { if (!open) return; setState({ description: "", - expiration: 30, + expiration: 0, }); setCreatedToken(null); }, [open]);