CompleteEmailVerificationFlow
Email-verification landing — mount on the route your verification
emails link to (the server builds {appFrontendURL}/auth/verify-email ?token=... from the app’s frontend_url). Reads the token from the
URL (or the token prop), exchanges it via /auth/verify-email on
mount, and renders one of four states:
- verifying →
loadingSlot(default: quiet status line) - success → confirmation + optional
continueHreflink - error →
renderErroroverride or inline alert - missing → no token in the URL (bad / truncated link)
Stateless about navigation: pass onSuccess to redirect, or let the
user click through via continueHref.
Usage
import { CompleteEmailVerificationFlow } from '@rw3iss/auth-client/preact/flows';
<CompleteEmailVerificationFlow onSuccess={(resp) => navigate("/")} onError={(err) => console.error(err)}/>Props
| Name | Type | Description |
|---|---|---|
client | AuthClient | |
token | string | Verification token. Default: `?token=` from the current URL. |
onSuccess | () => void | Called once after a successful verification. |
onError | (err: Error) => void | |
continueHref | string | Where the success (and missing-token) states link to, e.g. “/sign-in”. |
continueLabel | string | Label for the continue link. Default “Continue to sign in”. |
loadingSlot | ComponentChildren | Override the in-flight display. Default: quiet status line. |
renderError | (err: Error) => ComponentChildren | Override the error display. Default: inline alert + continue link. |
className | string |