web: open reset form immediately for reset links
Some checks failed
Android CI / android (push) Failing after 5m33s
Android Release / release (push) Has started running
CI / test (push) Has been cancelled

This commit is contained in:
Codex
2026-03-09 21:55:42 +03:00
parent 776a7634d2
commit 28f7da5f41
2 changed files with 29 additions and 13 deletions

View File

@@ -14,7 +14,7 @@ interface AuthPanelProps {
export function AuthPanel({ initialResetToken = null, onResetTokenConsumed }: AuthPanelProps) {
const login = useAuthStore((s) => s.login);
const loading = useAuthStore((s) => s.loading);
const [step, setStep] = useState<Step>("email");
const [step, setStep] = useState<Step>(initialResetToken?.trim() ? "reset" : "email");
const [email, setEmail] = useState("");
const [name, setName] = useState("");
const [username, setUsername] = useState("");
@@ -161,13 +161,21 @@ export function AuthPanel({ initialResetToken = null, onResetTokenConsumed }: Au
return (
<div className="mx-auto mt-16 w-full max-w-md rounded-2xl border border-slate-700/70 bg-panel p-6 shadow-xl">
<p className="mb-1 text-xl font-semibold">
{step === "email" ? "Sign in to BenyaMessenger" : step === "register" ? "Create account" : "Enter credentials"}
{step === "email"
? "Sign in to BenyaMessenger"
: step === "register"
? "Create account"
: step === "reset"
? "Reset password"
: "Enter credentials"}
</p>
<p className="mb-4 text-sm text-slate-400">
{step === "email"
? "Enter your email to continue"
: step === "register"
? "This email is not registered yet. Complete registration."
: step === "reset"
? "Enter a new password for your account."
: step === "password"
? "Enter your password"
: "Two-factor authentication is enabled"}