From e5fff3207980aba3ca1ac103a996cd5a20b09031 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 11 Dec 2025 10:42:43 -0600 Subject: [PATCH] only show jwt secret tip for admin users --- web/public/locales/en/views/settings.json | 3 +- .../components/overlay/SetPasswordDialog.tsx | 37 ++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/web/public/locales/en/views/settings.json b/web/public/locales/en/views/settings.json index cc3a1b727..e9fb17015 100644 --- a/web/public/locales/en/views/settings.json +++ b/web/public/locales/en/views/settings.json @@ -769,7 +769,8 @@ "updatePassword": "Update Password for {{username}}", "setPassword": "Set Password", "desc": "Create a strong password to secure this account.", - "multiDeviceWarning": "Any other devices where you are logged in will be required to re-login within {{refresh_time}}. You can also force all users to re-authenticate immediately by rotating your JWT secret." + "multiDeviceWarning": "Any other devices where you are logged in will be required to re-login within {{refresh_time}}.", + "multiDeviceAdmin": "You can also force all users to re-authenticate immediately by rotating your JWT secret." }, "changeRole": { "title": "Change User Role", diff --git a/web/src/components/overlay/SetPasswordDialog.tsx b/web/src/components/overlay/SetPasswordDialog.tsx index 8d8ce37f3..95c4e73be 100644 --- a/web/src/components/overlay/SetPasswordDialog.tsx +++ b/web/src/components/overlay/SetPasswordDialog.tsx @@ -26,6 +26,7 @@ import ActivityIndicator from "../indicators/activity-indicator"; import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; import { z } from "zod"; +import { useIsAdmin } from "@/hooks/use-is-admin"; type SetPasswordProps = { show: boolean; @@ -46,6 +47,7 @@ export default function SetPasswordDialog({ }: SetPasswordProps) { const { t } = useTranslation(["views/settings", "common"]); const { getLocaleDocUrl } = useDocDomain(); + const isAdmin = useIsAdmin(); const { data: config } = useSWR("config"); const refreshSeconds: number | undefined = @@ -233,19 +235,28 @@ export default function SetPasswordDialog({ ns: "views/settings", })}

-

- - {t("readTheDocumentation", { ns: "common" })} - - -

+ {isAdmin && ( + <> +

+ {t("users.dialog.passwordSetting.multiDeviceAdmin", { + ns: "views/settings", + })} +

+

+ + {t("readTheDocumentation", { ns: "common" })} + + +

+ + )}