import { Trans } from "@lingui/react/macro"; import { t } from "@lingui/core/macro"; import { LoaderCircle, MailIcon, SendHorizonalIcon } from "lucide-react" import { Input } from "../ui/input" import { Label } from "../ui/label" import { useCallback, useState } from "react" import { toast } from "../ui/use-toast" import { buttonVariants } from "../ui/button" import { cn } from "@/lib/utils" import { pb } from "@/lib/stores" import { Dialog, DialogHeader } from "../ui/dialog" import { DialogContent, DialogTrigger, DialogTitle } from "../ui/dialog" const showLoginFaliedToast = () => { toast({ title: t`Login attempt failed`, description: t`Please check your credentials and try again`, variant: "destructive", }) } export default function ForgotPassword() { const [isLoading, setIsLoading] = useState(false) const [email, setEmail] = useState("") const handleSubmit = useCallback( async (e: React.FormEvent) => { e.preventDefault() setIsLoading(true) try { // console.log(email) await pb.collection("users").requestPasswordReset(email) toast({ title: t`Password reset request received`, description: t`Check ${email} for a reset link.`, }) } catch (e) { showLoginFaliedToast() } finally { setIsLoading(false) setEmail("") } }, [email] ) return ( <>
setEmail(e.target.value)} id="email" name="email" required placeholder="name@example.com" type="email" autoCapitalize="none" autoComplete="email" autoCorrect="off" disabled={isLoading} className="ps-9" />
Command line instructions

If you've lost the password to your admin account, you may reset it using the following command.

Then log into the backend and reset your user account password in the users table.

./beszel superuser upsert user@example.com password docker exec beszel /beszel superuser upsert name@example.com password
) }