Checkpoint: Connexion locale avec identifiant libre (non-email), compte adminItinova créé, page Login mise à jour avec champ Identifiant

This commit is contained in:
Manus
2026-03-22 13:23:16 -04:00
parent cd11059a89
commit d8d2ef14da
4 changed files with 77 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ const ITINOVA_LOGO = "https://d2xsxph8kpxj0f.cloudfront.net/310519663070627318/f
const SANTINOVA_LOGO = "https://d2xsxph8kpxj0f.cloudfront.net/310519663070627318/fo4DRyBgjsuiigFAgNLuWm/santinova-logo_5ae0d248.webp";
export default function Login() {
const [email, setEmail] = useState("");
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const loginMutation = trpc.auth.loginLocal.useMutation({
@@ -26,7 +26,7 @@ export default function Login() {
const handleLocalLogin = (e: React.FormEvent) => {
e.preventDefault();
loginMutation.mutate({ email, password });
loginMutation.mutate({ email: username, password });
};
return (
@@ -52,15 +52,16 @@ export default function Login() {
<form onSubmit={handleLocalLogin} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="email">Email</Label>
<Label htmlFor="username">Identifiant</Label>
<Input
id="email"
type="email"
placeholder="votre@email.com"
value={email}
onChange={(e) => setEmail(e.target.value)}
id="username"
type="text"
placeholder="Votre identifiant"
value={username}
onChange={(e) => setUsername(e.target.value)}
required
autoFocus
autoComplete="username"
/>
</div>
@@ -73,6 +74,7 @@ export default function Login() {
value={password}
onChange={(e) => setPassword(e.target.value)}
required
autoComplete="current-password"
/>
</div>