Skip to content
rw3iss Auth

RegisterForm

form @rw3iss/auth-client/preact/forms/RegisterForm framework-adapters/preact/components/forms/RegisterForm.tsx ↗

Account-creation form. Captures the four core register fields (email, password, first/last name) plus optional invite handling.

Password strength: the SDK forwards whatever the user types — the server is the source of truth on password policy (min length, complexity, etc). This form surfaces server validation errors via the action hook’s error slot.

On success: AuthClient transitions to authenticated automatically (registration returns a token pair). The optional onSuccess callback is for navigation / analytics.

Usage

import { RegisterForm } from '@rw3iss/auth-client/preact/forms';
<RegisterForm
organizationId={currentOrgId}
onSuccess={(resp) => navigate("/")}
onError={(err) => console.error(err)}
/>

Props

NameTypeDescription
clientAuthClient
defaultEmailstringPre-fill email (e.g. from an invite link).
inviteCodestringInvite code surfaced to /auth/register.
inviteTokenstringInvite token (signed link).
organizationIdstringOrganization the new user is joining.
appCodestringApp code that scopes registration. The server applies this app’s `allowed_email_domains` + `allowed_auth_methods` policy and auto-adds the new user to its `default_organization_id`. Default falls back to the AuthClient’s configured app code. /
allowedEmailDomainsstring[]Client-side email-domain pre-validation. Bare domains (no ’@’), matched case-insensitively. Empty / undefined disables the check (server still enforces). Typically wired from `useAppPolicy().policy.allowed_email_domains` so the form’s UX matches the server’s policy. /
belowSubmitComponentChildrenSlot rendered below the submit button (e.g. “Already have an account?”).
aboveFormComponentChildrenSlot rendered above the form.
onSuccess(resp: AuthResponse) => void
onError(err: Error) => void
classNamestring