Skip to content
rw3iss Auth

CompleteSsoCallbackFlow

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

SSO callback handler — mount on your redirectUrl route (the same URL passed to startSso). Reads code and state from the URL search params and exchanges them for tokens via /auth/sso/callback.

Behavior

  • Loading → renders the loadingSlot (default spinner).
    • Success → calls onSuccess(resp) so the consumer can navigate away (typically to the post-login destination).
    • Error → renders errorSlot with the message.

Works for both PKCE and non-PKCE flows; the SDK handles the conditional auth_code → /auth/sso/exchange step internally.

Usage

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

Props

NameTypeDescription
clientAuthClient
onSuccess(resp: AuthResponse) => void
onError(err: Error) => void
loadingSlotComponentChildren
renderError(err: Error) => ComponentChildrenOverride the error display. Default: inline alert.
classNamestring