CompleteSsoCallbackFlow
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
errorSlotwith the message.
- Success → calls
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
| Name | Type | Description |
|---|---|---|
client | AuthClient | |
onSuccess | (resp: AuthResponse) => void | |
onError | (err: Error) => void | |
loadingSlot | ComponentChildren | |
renderError | (err: Error) => ComponentChildren | Override the error display. Default: inline alert. |
className | string |