Create demo org shell before Queue login redirect.
Deploy Ladill Queue / deploy (push) Successful in 1m19s
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user