Skip to main content
Navigate the user to the upgrade app, then handle the outcome when they return. This is the simplest route — see the overview for detection, hosting, and the shared CORS requirements. The return leg is two functions, matching how social sign-in and device registration consume their redirects:
  • detectUpgradeRedirect({ url }) — a pure, synchronous check for whether the URL is a return from the upgrade app.
  • completeUpgradeRedirect({ url }, client?) — reads the outcome, refreshes the session on success, and returns it (null when there’s nothing to consume). The refresh is best-effort: the upgrade already succeeded on the backend, so a failed refresh still reports success and reconciles on the next auth refresh.
You always pass the URL yourself — window.location.href.

Handling errors

See also

Last modified on July 24, 2026