Fix guest join flow redirecting to Care marketing page.
Deploy Ladill Meet / deploy (push) Successful in 52s
Deploy Ladill Meet / deploy (push) Successful in 52s
Guests were sent through silent SSO after entering the meeting room because /room routes required auth; failed SSO fell back to leftover Care config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -88,7 +88,11 @@ class SsoLoginController extends Controller
|
||||
if ($request->filled('error')) {
|
||||
if (in_array($request->query('error'), ['login_required', 'interaction_required', 'consent_required'], true)
|
||||
&& ! $request->boolean('interactive')) {
|
||||
return redirect()->away((string) config('ladill.marketing_url'));
|
||||
return redirect()->route('sso.connect', [
|
||||
'redirect' => $intended,
|
||||
'interactive' => 1,
|
||||
'fallback' => 1,
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->finishCallback($request, $intended, (string) $request->query('error_description', $request->query('error')));
|
||||
@@ -285,6 +289,10 @@ class SsoLoginController extends Controller
|
||||
|
||||
private function resolveLanding(IdentityTeamClient $identity, User $user, string $intended): string
|
||||
{
|
||||
if ($this->isMeetJoinUrl($intended)) {
|
||||
return $intended;
|
||||
}
|
||||
|
||||
try {
|
||||
return $identity->postAuthRedirect($user->ownerRef(), $intended);
|
||||
} catch (\Throwable) {
|
||||
@@ -292,6 +300,14 @@ class SsoLoginController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
private function isMeetJoinUrl(string $url): bool
|
||||
{
|
||||
$meetHost = config('app.meet_domain', 'meet.ladill.com');
|
||||
|
||||
return str_starts_with($url, 'https://'.$meetHost.'/r/')
|
||||
|| str_starts_with($url, 'http://'.$meetHost.'/r/');
|
||||
}
|
||||
|
||||
private function safeReturnUrl(string $url): string
|
||||
{
|
||||
$host = parse_url($url, PHP_URL_HOST);
|
||||
|
||||
Reference in New Issue
Block a user