fix(onboarding): gate direct access behind the OAuth handoff

/portal/onboarding is only a step in the Google sign-in flow. Redirect to
login unless the login page's onboard_email handoff hint is present (and the
session is authenticated), instead of showing an empty form on direct/typed
URL access. Hold rendering until the check passes to avoid a form flash, and
clear the hint once onboarding completes so it can't be reused.
This commit is contained in:
tanweer919
2026-07-13 04:01:01 +05:30
parent 08ef85869f
commit d79da8cd6a
2 changed files with 22 additions and 4 deletions
+2
View File
@@ -120,6 +120,8 @@ export function RegisterFlow({ mode = "register" }: { mode?: "register" | "onboa
// register mode: non-fatal — the auth account exists; the profile can be filled in later.
}
}
// Consume the OAuth→onboarding handoff so a stale hint can't re-open onboarding.
try { sessionStorage.removeItem("onboard_email"); } catch { /* ignore */ }
router.push("/dashboard");
}