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
+27
View File
@@ -12,6 +12,10 @@ use Illuminate\Support\Facades\Log;
* Only owner demo accounts trigger a full reseed. DemoWorld staff logins
* (e.g. receptionist@ladill.com variants) share the owner tenant but must
* never reseed mid-demo.
*
* The onboarded org shell is created synchronously before the login redirect so
* EnsureOrganizationSetup never flashes the blank onboarding form. Heavy demo
* data still refreshes afterResponse().
*/
class DemoLoginReseeder
{
@@ -38,6 +42,29 @@ class DemoLoginReseeder
$lockKey = 'demo-reseed:queue:'.$seedUser->public_id;
if (! Cache::add($lockKey, 1, 120)) {
try {
app(DemoSeeder::class)->ensureOnboardedShell($seedUser, $plan);
} catch (\Throwable $e) {
Log::warning('demo_queue_login_shell_failed', [
'user_id' => $seedUser->id,
'plan' => $plan,
'error' => $e->getMessage(),
]);
}
return;
}
try {
app(DemoSeeder::class)->ensureOnboardedShell($seedUser, $plan);
} catch (\Throwable $e) {
Cache::forget($lockKey);
Log::warning('demo_queue_login_shell_failed', [
'user_id' => $seedUser->id,
'plan' => $plan,
'error' => $e->getMessage(),
]);
return;
}