// Network sign-in, the sign-in page side (2026-11-12). The SAME file ships in InstantAdPay and LinkSpin (see networksso.js). // On a sign-in screen with no session: ask /api/sso/status once; { check: true } means bounce once through the other site, // which signs the member in here if they are signed in there (the server allows one try per browser per 30 minutes and none // after a sign-out). { hint } means they came from the other site but need the email code here the first time: fill it in. (function () { if (window.__netsso) return; window.__netsso = 1; const BOXES = '#mcEmail,#jnEmail,#siEmail'; function fill(email, peer) { let n = 0; const t = setInterval(() => { const el = document.querySelector(BOXES); if (el && el.offsetParent !== null) { clearInterval(t); if (!el.value) el.value = email; if (!document.getElementById('nssoNote')) { const p = document.createElement('p'); p.id = 'nssoNote'; p.className = 'muted small'; p.setAttribute('role', 'note'); p.style.margin = '6px 0'; p.textContent = 'Welcome over from ' + peer + '. The first time here, send yourself a code with the same email to finish signing in. After that, ' + peer + ' signs you in here.'; (el.closest('label') || el).insertAdjacentElement('afterend', p); } try { el.focus(); } catch (e) {} } else if (++n > 60) clearInterval(t); }, 250); } fetch('/api/sso/status', { credentials: 'same-origin', headers: { Accept: 'application/json' }, cache: 'no-store' }) .then(r => r.json()).then(d => { if (!d) return; if (d.check) { location.replace('/sso/start?mode=check&to=' + encodeURIComponent(location.pathname + location.search + location.hash)); return; } if (d.hint) fill(String(d.hint), String(d.peer || 'the other site')); }).catch(() => {}); })();