LoginForm
Sign in with email + password on the evolve-feature-form pattern.
Self-contained: runs useLogin, maps server errors by code
(AuthenticationError → form-level, ValidationError → per-field), and
delegates session-setting to AuthProvider's onAuthenticated seam.
import { LoginForm } from "@evolve-storefront/feature-auth/login-form";Renders inside AuthProvider.
Preview
Usage
// Runs the login mutation; AuthProvider's onAuthenticated sets the session.<LoginForm onLoggedIn={() => router.push("/account")} />;Props
| Prop | Type | Description |
|---|---|---|
validationBehavior? | "aria" | "native" | Default |
onLoggedIn? | ((customer: AuthCustomer) => void) | Called with the customer on success (alongside the provider's session seam). |
defaultValues? | { email?: string | undefined; } |
Any other props go to the root element, like on a plain HTML element.
Examples
With ErrorWrong credentials: the server refuses the login and the form says so above the submit button.
// An AuthenticationError renders as the form-level alert; nothing to wire.<LoginForm onLoggedIn={() => router.push("/account")} />;PrefilleddefaultValues prefills the email, e.g.
<LoginForm defaultValues={{ email: searchParams.get("email") ?? "" }} onLoggedIn={() => router.push("/account")}/>;
