Files
ladill-queue/resources/views/partials/sso-keepalive.blade.php
T
isaaccladandCursor d2803fafb5
Deploy Ladill Queue / deploy (push) Successful in 1m26s
Throttle platform SSO session checks to cut per-request auth latency.
Verify auth.ladill.com at most once every 90s; recommend Redis for session/cache in .env.example.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 16:49:09 +00:00

22 lines
754 B
PHP

@if (auth()->check())
@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