Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore(access-token): default expiration to never

boojackcc20327b8a1d
diff --git a/web/src/components/CreateAccessTokenDialog.tsx b/web/src/components/CreateAccessTokenDialog.tsx
index e12338187..a36e96fef 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<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]);