fix(web): preserve browser OAuth callbacks - #4953
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change since Incremental scopeDiff reviewed:
No other file changed in this increment, so no other file was re-reviewed for new findings. Status of previously raised findings
Files Reviewed (1 file)
Previous Review Summary (commit 242483f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 242483f)Status: 4 Issues Found | Recommendation: Address before merge Executive SummaryThe new Overview
Issue Details (click to expand)WARNING
SUGGESTION
Verified clean
Notes and assumptions
Files Reviewed (11 files)
Reviewed by claude-opus-5 · Input: 32 · Output: 5.6K · Cached: 646.1K Review guidance: REVIEW.md from base branch |
Summary
What
Route browser OAuth and signup completion redirects that land on app-claimed paths through a new
/users/continueinterstitial.Why
iOS Universal Links and Android App Links can hand a browser document navigation to the installed app. A mobile-browser OAuth return ending at
/profile(or another claimed callback path) therefore prevents web login from completing in that browser.How
browserLandingPathguard backed byUNIVERSAL_LINK_ROUTES./users/continue, which validates the target then uses client-siderouter.replacefor the final hop.Verification
pnpm typecheck— passedpnpm lint— passedpnpm run format:changed— passedcd apps/web && pnpm test— 694 suites passed; one pre-existing unrelated timeout failed insrc/lib/kiloclaw/subscription-schema.test.tsduring database cleanup/clawauth server redirects target the handoff, hostiletovalues stay local,kiloapp://profilepreserves profile deep-link resolution, and a fresh single-org user redirects directly to its organization without a handoff.Continuingloading state after the copy repair.E2E limitation
Native OS-level universal-link interception (Safari handing a claimed URL to the installed app) cannot be reproduced in a simulator: the local dev build does not have an App-Store-signed production AASA association or a real cross-domain OAuth return. The E2E verifier did not claim to verify or refute that OS behavior. The unit tests are the authoritative proof that auth server redirects route claimed targets through the interstitial.
Universal-link scope
The shared universal-link table and both
.well-knownfiles are deliberately unchanged. Mobile files are unchanged as well, preserving existing deep-link and Smart App Banner behavior.Deferred Stripe/payment returns
These audited same-class defects are deliberately out of scope for this authentication-only PR:
apps/web/src/lib/stripe/index.ts:1418/profile?auto_topup_setup=cancelledapps/web/src/routers/kilo-pass-router.ts:1755/profile(billing-portalreturn_url)apps/web/src/routers/kilo-pass-router.ts:2375/profile?kilo_pass_checkout=cancelledapps/web/src/routers/kiloclaw-router.ts:5900/claw?checkout=cancelledapps/web/src/routers/kiloclaw-router.ts:6344/claw(billing-portalreturn_url)apps/web/src/lib/stripe/index.ts:1489,1613;kiloclaw-router.ts:5504cancelUrlvariables — trace before fixingapps/web/src/app/payments/auto-topup/success/route.ts:8/profile?auto_topup_setup=successVisual Changes