"use client"; import { useActionState } from "react"; import { motion } from "framer-motion"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { AuthCard, AuthError, PasswordField, SubmitButton, authGroup, authRise, } from "@/components/login-form"; import { setNewPasswordAction } from "@/server/actions"; /** * Set your own password, when the one you have was handed to you. * * Deliberately not the Settings form: there is no current-password field, * because the whole premise is that the password you know is one somebody else * chose, and asking you to prove you have it proves nothing about you. The * session cookie is the proof, and the flag on the account is the reason. */ export function ForcedPasswordForm({ instanceName, email, claiming = false, }: { instanceName: string; email: string; /** The owner's first sign-in, still on the placeholder address. */ claiming?: boolean; }) { const [state, formAction] = useActionState(setNewPasswordAction, undefined); return ( {claiming ? ( ) : ( /* Here so a password manager files the new password against the right account, and so the person can see which one they are fixing. */ )} ); }