Route event registration paths directly to Events so confirmation pages resolve.
Deploy Ladill Link / deploy (push) Successful in 1m30s
Deploy Ladill Link / deploy (push) Successful in 1m30s
ladl.link was proxying registered/* through ladill.com first, where registrations do not exist, causing 404s after successful event signup. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -27,6 +27,10 @@ class LinkPlatformProxy
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->isEventsRegistrationPath($normalizedPath)) {
|
||||||
|
return $this->forwardToQrHub($request, $slug, $normalizedPath, $this->eventsBaseUrl());
|
||||||
|
}
|
||||||
|
|
||||||
$platformResponse = $this->forwardToQrHub($request, $slug, $normalizedPath, $this->platformBaseUrl());
|
$platformResponse = $this->forwardToQrHub($request, $slug, $normalizedPath, $this->platformBaseUrl());
|
||||||
if ($platformResponse->getStatusCode() !== 404) {
|
if ($platformResponse->getStatusCode() !== 404) {
|
||||||
return $platformResponse;
|
return $platformResponse;
|
||||||
@@ -107,6 +111,13 @@ class LinkPlatformProxy
|
|||||||
return $this->forward($request, $slug, substr($path, strlen($slugPrefix)));
|
return $this->forward($request, $slug, substr($path, strlen($slugPrefix)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function isEventsRegistrationPath(string $path): bool
|
||||||
|
{
|
||||||
|
return $path === 'register'
|
||||||
|
|| str_starts_with($path, 'register/')
|
||||||
|
|| str_starts_with($path, 'registered/');
|
||||||
|
}
|
||||||
|
|
||||||
private function platformBaseUrl(): string
|
private function platformBaseUrl(): string
|
||||||
{
|
{
|
||||||
return rtrim((string) config('app.platform_url', 'https://ladill.com'), '/');
|
return rtrim((string) config('app.platform_url', 'https://ladill.com'), '/');
|
||||||
|
|||||||
@@ -123,4 +123,35 @@ class LinkRedirectTest extends TestCase
|
|||||||
&& $request->hasHeader('X-Ladill-Internal', '1');
|
&& $request->hasHeader('X-Ladill-Internal', '1');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_event_registration_confirmation_proxies_directly_to_events_app(): void
|
||||||
|
{
|
||||||
|
$user = $this->user();
|
||||||
|
ShortLink::create([
|
||||||
|
'user_id' => $user->id,
|
||||||
|
'slug' => 'sales-webinar',
|
||||||
|
'source_app' => 'events',
|
||||||
|
'source_kind' => 'qr',
|
||||||
|
'is_managed_here' => false,
|
||||||
|
'destination_url' => 'https://ladl.link/sales-webinar',
|
||||||
|
'is_active' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
Http::fake([
|
||||||
|
'https://events.ladill.com/q/sales-webinar/registered/QRE-TESTREF123456' => Http::response('<html>Registration confirmed</html>', 200),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->get('https://ladl.link/sales-webinar/registered/QRE-TESTREF123456')
|
||||||
|
->assertOk()
|
||||||
|
->assertSee('Registration confirmed');
|
||||||
|
|
||||||
|
Http::assertSent(function ($request) {
|
||||||
|
return $request->url() === 'https://events.ladill.com/q/sales-webinar/registered/QRE-TESTREF123456'
|
||||||
|
&& $request->hasHeader('X-Ladill-Internal', '1');
|
||||||
|
});
|
||||||
|
|
||||||
|
Http::assertNotSent(function ($request) {
|
||||||
|
return str_starts_with($request->url(), 'https://ladill.com/q/sales-webinar/registered/');
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user