Create demo org shell before Queue login redirect.
Deploy Ladill Queue / deploy (push) Successful in 1m19s

Match Care: guarantee onboarded org on the SSO request path so launcher/login never flashes onboarding during async reseed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-17 19:33:12 +00:00
co-authored by Cursor
parent 735a35634f
commit 8062cce8d1
4 changed files with 69 additions and 1 deletions
+18
View File
@@ -71,8 +71,13 @@ class DemoSeeder
$plan = $this->normalizePlan($plan);
$user = $this->resolveUser($identity);
// Always materialize the onboarded org shell before any wipe so concurrent
// SSO redirects never land on the blank onboarding form.
$this->ensureOnboardedShell($user, $plan);
if ($reset) {
$this->resetForOwner($user->ownerRef());
$this->ensureOnboardedShell($user, $plan);
}
$organization = $this->ensureOrganization($user, $plan);
@@ -160,6 +165,19 @@ class DemoSeeder
];
}
/**
* Ensure the demo tenant has an onboarded organization + owner member.
* Safe to call on the SSO request path before redirecting.
*/
public function ensureOnboardedShell(User $user, string $plan): Organization
{
$plan = $this->normalizePlan($plan);
$organization = $this->ensureOrganization($user, $plan);
$this->assignPlan($organization, $plan);
return $organization->fresh() ?? $organization;
}
public function resolveUser(string $identity): User
{
$identity = trim($identity);