Skip to content
rw3iss Auth

MagicLinkRequestForm

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

“Email me a sign-in link” form. Anonymous. Server responds 204 regardless of whether the email is registered — anti-enumeration — so the success state just tells the user to check their inbox.

Drop next to the LoginForm as an alternative login path. The AuthClient.verifyMagicLink call (on the /auth/magic-link/verify route) completes the round-trip; see CompleteMagicLinkFlow for the paired verifier.

Usage

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

Props

NameTypeDescription
clientAuthClient
defaultEmailstring
successMessagestringOverride the success message.
appCodestringApp code override. Defaults to the AuthClient’s configured one.
onSuccess() => void
onError(err: Error) => void
classNamestring