mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-03 06:15:02 +00:00
only show jwt secret tip for admin users
This commit is contained in:
parent
649ca49e55
commit
e5fff32079
@ -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",
|
||||
|
||||
@ -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",
|
||||
})}
|
||||
</p>
|
||||
<p className="text-sm text-primary-variant">
|
||||
<a
|
||||
href={getLocaleDocUrl(
|
||||
"configuration/authentication#jwt-token-secret",
|
||||
)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center text-primary"
|
||||
>
|
||||
{t("readTheDocumentation", { ns: "common" })}
|
||||
<LuExternalLink className="ml-2 size-3" />
|
||||
</a>
|
||||
</p>
|
||||
{isAdmin && (
|
||||
<>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t("users.dialog.passwordSetting.multiDeviceAdmin", {
|
||||
ns: "views/settings",
|
||||
})}
|
||||
</p>
|
||||
<p className="text-sm text-primary-variant">
|
||||
<a
|
||||
href={getLocaleDocUrl(
|
||||
"configuration/authentication#jwt-token-secret",
|
||||
)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center text-primary"
|
||||
>
|
||||
{t("readTheDocumentation", { ns: "common" })}
|
||||
<LuExternalLink className="ml-2 size-3" />
|
||||
</a>
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
</DialogHeader>
|
||||
|
||||
<Form {...form}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user