diff --git a/web/src/views/Login.tsx b/web/src/views/Login.tsx index 54b3dd7..402fd98 100644 --- a/web/src/views/Login.tsx +++ b/web/src/views/Login.tsx @@ -1,5 +1,5 @@ import { useEffect, useState, type FormEvent } from "react"; -import { Eye, EyeOff, LogIn, ShieldCheck } from "lucide-react"; +import { Eye, EyeOff, LogIn } from "lucide-react"; import { useSession } from "@/store/session"; import { ApiError } from "@/jmap/client"; import { DEFAULT_SOURCE_URL } from "@/lib/source"; @@ -21,8 +21,6 @@ export function LoginPage() { }, []); const [username, setUsername] = useState(() => localStorage.getItem("ihasmail:lastUser") ?? ""); const [password, setPassword] = useState(""); - const [totp, setTotp] = useState(""); - const [showTotp, setShowTotp] = useState(false); const [showPw, setShowPw] = useState(false); const [remember, setRemember] = useState(true); const [busy, setBusy] = useState(false); @@ -34,13 +32,14 @@ export function LoginPage() { setBusy(true); setError(null); try { - await login(username.trim(), password, totp.trim(), remember); + // No two-factor code: the field is not on this form until the flow works + // end to end, and the server treats an absent code as none given. + await login(username.trim(), password, "", remember); localStorage.setItem("ihasmail:lastUser", username.trim()); } catch (err) { if (err instanceof ApiError) { if (err.code === "invalid_credentials") { - setError(showTotp ? "Invalid credentials or verification code." : "Invalid username or password."); - if (!showTotp && password) setShowTotp(true); + setError("Invalid username or password."); } else if (err.code === "rate_limited") setError("Too many attempts. Please wait a few minutes and try again."); else setError(err.message || "Could not sign in."); } else setError("Network error. Please check your connection."); @@ -75,29 +74,6 @@ export function LoginPage() { - {showTotp ? ( -