forked from Goutam/lynkeduppro-crm
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:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user