chore(access-token): default expiration to never
This commit is contained in:
@@ -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<string | null>(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<State>) => {
|
||||
@@ -109,7 +109,7 @@ function CreateAccessTokenDialog({ open, onOpenChange, onSuccess }: Props) {
|
||||
if (!open) return;
|
||||
setState({
|
||||
description: "",
|
||||
expiration: 30,
|
||||
expiration: 0,
|
||||
});
|
||||
setCreatedToken(null);
|
||||
}, [open]);
|
||||
|
||||
Reference in New Issue
Block a user