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.
useUpgradeRedirectResult runs the detect + complete steps once on mount and strips the result parameter from the URL for you. Drive your UI off result (the outcome once the user returns, undefined until then) and error (set if consuming the return fails). onComplete / onError callbacks are also available if you prefer.
Handling errors
See also
Last modified on September 21, 2026