From 327dc6e7e6e16197541b788722c91f5b8acfdd09 Mon Sep 17 00:00:00 2001 From: Sourov Biswas Date: Sun, 20 Sep 2026 16:39:57 +0600 Subject: [PATCH] Send a user with no organization from the welcome page to onboarding The welcome page's "Dashboard" button, and the "Open dashboard" call to action under the headline, both fall back to "/" when the signed in user has no organization. That is the page they are already on, so the button reads as broken: nothing happens. The fallback predates onboarding. It was written when registration still created an organization for every new user, so "no organization" could not happen and "/" was as good as anywhere. When 2c77d46 stopped auto-creating organizations it pointed the sidebar at the onboarding page but left the welcome page behind; ProductSyncManager and the compliance platform updated both. Co-Authored-By: Claude Opus 5 --- resources/js/pages/welcome.tsx | 4 ++-- tests/Browser/OnboardingTest.php | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/resources/js/pages/welcome.tsx b/resources/js/pages/welcome.tsx index 83e0009..1512cde 100644 --- a/resources/js/pages/welcome.tsx +++ b/resources/js/pages/welcome.tsx @@ -11,7 +11,7 @@ import { } from 'lucide-react'; import AppLogoIcon from '@/components/app-logo-icon'; import { Button } from '@/components/ui/button'; -import { dashboard, home, login, register } from '@/routes'; +import { dashboard, home, login, onboarding, register } from '@/routes'; const features = [ { @@ -75,7 +75,7 @@ export default function Welcome() { const { auth, currentOrganization, name } = usePage().props; const dashboardUrl = currentOrganization ? dashboard(currentOrganization.slug) - : '/'; + : onboarding(); return ( <> diff --git a/tests/Browser/OnboardingTest.php b/tests/Browser/OnboardingTest.php index 1e466bf..2f3d0ae 100644 --- a/tests/Browser/OnboardingTest.php +++ b/tests/Browser/OnboardingTest.php @@ -39,3 +39,15 @@ $this->assertDatabaseCount('organizations', 0); }); + +test('the welcome page sends a user without an organization to onboarding', function () { + $user = User::factory()->withoutOrganization()->create(); + + $this->actingAs($user); + + visit(route('home')) + ->click('Dashboard') + ->assertPathIs('/onboarding') + ->assertSee('Create your first organization') + ->assertNoJavaScriptErrors(); +});