AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(frontend): drop /signup → / hop that flashes /copilot before /onboarding (#13154)
### Why / What / How
**Why**: New users who finish the signup form, and logged-in users who
land on `/signup` or `/login`, briefly see the `/copilot` homescreen
before being sent to `/onboarding`. The bounce is `/signup` → `/` →
`/copilot` → `/onboarding`, and each hop renders before the next
redirect kicks in — the intermediate `/copilot` render is the flash
users see. The LD angle is real: `LaunchDarklyProvider`
unmounts/remounts its subtree on every `isUserLoading` flip, which
resets `OnboardingProvider.hasInitialized` and delays the corrective
redirect behind another awaited `getV1CheckIfOnboardingIsCompleted`
call. While that promise is in flight, `/copilot` sits on screen.
**What**: Stop `useSignupPage` / `useLoginPage` from pushing to `"/"`
when the user is logged in (which always redirects to `/copilot` via
`app/page.tsx`). Let `OnboardingProvider` make the routing decision, and
extend it to also handle completed users sitting on `/signup` or
`/login` so they aren't stranded on the auth-page loader.
**How**:
1. Narrow the auth-page `useEffect`s so they only honour an explicit
`?next=` deep link. The generic "I'm logged in, get me off this page"
case is now routed by `OnboardingProvider`, which knows whether to send
the user to `/onboarding` or `/copilot`.
2. Add `isOnAuthRoute` to the `OnboardingProvider`'s "completed" branch
so a logged-in user with completed onboarding on `/signup` or `/login`
is sent straight to `/copilot` (otherwise they'd be stuck on
`LoadingSignup` forever now that the auth-page redirect is gone).
### Changes 🏗️
- `useSignupPage.ts`: skip the `router.push("/")` when no `?next=` is
set.
- `useLoginPage.ts`: same change for the `/login` mirror of the same
useEffect.
- `onboarding-provider.tsx`: introduce `isOnAuthRoute`; broaden the
completed-onboarding redirect to include `/signup` and `/login`; add it
to the effect dep list.
### Checklist 📋
#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [ ] I have tested my changes according to the test plan:
- [x] `pnpm format`, `pnpm lint`, `pnpm types`, `pnpm test:unit` all
pass on the branch (203 test files / 2660 tests passing)
- [ ] Fresh signup: confirm the user goes straight to `/onboarding`
welcome step with no `/copilot` flicker
- [ ] Re-visit `/signup` while logged in with incomplete onboarding:
should land on `/onboarding`, no `/copilot` flicker
- [ ] Re-visit `/signup` while logged in with completed onboarding:
should land on `/copilot`
- [ ] Re-visit `/signup?next=/library` while logged in: should land on
`/library`
- [ ] Same matrix for `/login`
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> U
Ubbe committed
270cd1eeb558c35b890c9cd9f62573298af48cd6
Parent: 39fcbeb
Committed by GitHub <noreply@github.com>
on 5/18/2026, 1:13:26 PM