Login Form
BlockBasic Usage
Loading...
Installation
pnpm add @corew500/uiUsage
import { LoginForm } from "@corew500/ui/blocks/login-form"
<LoginForm>Content</LoginForm>API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| action* | SignInAction | — | Server action for signing in. Import from '@corew500/feature-auth/server' and pass as prop. @example ```tsx import { LoginForm } from '@corew500/feature-auth' import { signIn } from '@corew500/feature-auth/server' export default function Page() { return <LoginForm action={signIn} signUpHref="/signup" /> } ``` |
| validation | AuthValidationOptions | — | Validation configuration |
| locale | string | — | Locale for i18n-aware redirects |
| redirectTo | enum | "/dashboard" | Custom redirect path after login, or false to disable auto-redirect. When false, you must handle navigation in onSuccess callback. |
| onSuccess | (data: LoginSuccessData) => void | Promise<void> | — | Called after successful login. Can be async - the form will await completion before redirecting. |
| onAuthError | (error: AuthFormError) => void | — | Called when login fails. Receives the error code (if available) and message. |
| onSubmitStart | () => void | — | Called immediately before the form submits. Useful for analytics, global loading states, or last-minute checks. |