Skip to main content

SSOCallback

Handles OAuth and SSO callbacks from external identity providers like Google, GitHub, and enterprise SAML providers. Create a route for the OAuth callback that matches your redirect URI configured in the Wacht dashboard:
import { SSOCallback } from "@wacht/tanstack-router";

export default function SSOCallbackPage() {
  return <SSOCallback />;
}

Behavior

  1. Reads OAuth callback parameters from the URL (code, state, error)
  2. Validates the OAuth state parameter
  3. Calls the appropriate backend endpoint to complete the flow
  4. Handles errors (access denied, invalid state, etc.) with an error message banner
  5. Redirects to the appropriate page after completion
The state parameter supports:
  • sign_in - Standard sign-in flow
  • connect_social - Connecting a social account to an existing user

Query Parameters

code
string
OAuth authorization code.
state
string
OAuth state parameter (base64 encoded).
error
string
OAuth error code.
error_description
string
OAuth error description.