Bind app sessions to the platform auth session.
Deploy Ladill Servers / deploy (push) Successful in 26s

Clear local sessions when auth.ladill.com signs out and ping the platform session from keepalive.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-20 08:26:30 +00:00
co-authored by Cursor
parent 2094eafd98
commit fa38d1e06c
5 changed files with 94 additions and 3 deletions
@@ -1,4 +1,21 @@
@if (auth()->check())
{{-- Same-site iframe keeps the shared auth.ladill.com session warm while using this app. --}}
<iframe src="https://{{ config('app.auth_domain') }}/sso/ping" hidden width="0" height="0" title=""></iframe>
@php
$authPing = 'https://'.config('app.auth_domain').'/sso/ping';
$platformSignedOutUrl = route('sso.platform-signed-out', ['redirect' => url()->current()]);
@endphp
<script>
(function () {
const pingUrl = @js($authPing);
const signedOutUrl = @js($platformSignedOutUrl);
const ping = () => fetch(pingUrl, { credentials: 'include' })
.then((response) => {
if (response.status === 401) {
window.location.href = signedOutUrl;
}
})
.catch(() => {});
ping();
setInterval(ping, 5 * 60 * 1000);
})();
</script>
@endif