Skip to content

ConnectConfirmForm

For a customer signed in on the site: one password field, which signs in again as email to start the client's own session. Spread useConnectForm onto it from a client component, as onto LoginFormView.

import { ConnectConfirmForm } from "@evolve-storefront/feature-mcp-connect/connect-confirm-form";

Preview

DefaultOpen in Storybook ↗

Usage

The default: one password field and the button.

"use client";
const binding = useConnectForm({
signIn: connectWithPassword,
resolveError: useAuthErrorMessages(),
});
return <ConnectConfirmForm email={customer.email} {...binding} />;

Props

PropTypeDescription
emailstring

The customer signed in on the site, whom the password confirms.

onValidSubmit(values: { email: string; password: string; }) => void

Called with email and the password. useConnectForm supplies it.

validationBehavior?"aria" | "native"

Default "aria": mark fields via ARIA rather than blocking native submit. The form is then noValidate, so an input's own constraint (type="email") never stops the submit with a browser tooltip that the field's error does not match.

isPending?boolean
error?string | null

Shown above the button, such as a wrong password.

serverErrors?FormValidationErrors

Any other props go to the root element, like on a plain HTML element.