Skip to content
rw3iss Auth

CompleteEmailVerificationFlow

flow @rw3iss/auth-client/preact/flows/CompleteEmailVerificationFlow framework-adapters/preact/components/flows/CompleteEmailVerificationFlow.tsx ↗

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 continueHref link
  • error → renderError override 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

NameTypeDescription
clientAuthClient
tokenstringVerification token. Default: `?token=` from the current URL.
onSuccess() => voidCalled once after a successful verification.
onError(err: Error) => void
continueHrefstringWhere the success (and missing-token) states link to, e.g. “/sign-in”.
continueLabelstringLabel for the continue link. Default “Continue to sign in”.
loadingSlotComponentChildrenOverride the in-flight display. Default: quiet status line.
renderError(err: Error) => ComponentChildrenOverride the error display. Default: inline alert + continue link.
classNamestring