Network hub sign-in, step 3 (Marty 2026-11-15)
networksso.js (the same file on every network site): with HUB_SSO=on /sso/start asks the network hub, /sso/in takes the hub's h1. token (this site's HUB_SECRET, iss hub, aud linkspin, 60 s, single use, state cookie) and falls back once to the pairwise InstantAdPay check when the hub has nobody. networksso.page() on every GET of the main host: a signed-in member's page load tells the hub once (nsso.hp) and pings /v1/activity once a day, only while the hub answers /health. Sessions: SESSION_TTL_HOURS (168 = 7 days in production), renewed on use at most hourly; cookie 30 days, the server's sliding expiry decides. auth.endSessions. Sign out everywhere: POST /api/auth/logout-everywhere; the account menu's Sign out asks "Only LinkSpin or every network site"; cr-shell.js?v=20261115hub. hubsync: member.blocked and member.signedout end every session of that member here. Chatbot: a sign-in lasts 7 days and renews; the silent check is every 2 minutes. Tests: qa/networksso-hub.e2e.mjs (same file as InstantAdPay, in run.sh). qa sso: ALL PASSED; qa member: ALL PASSED (known warnings). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -123,6 +123,10 @@ async function apply(ev) {
|
||||
if (!R.erase) return;
|
||||
const r = await R.erase.byHash(ev.data && ev.data.emailHash, 'hub');
|
||||
if (r.result === 'refused') console.error('hubsync member.erased refused here:', String(r.error || '').slice(0, 200));
|
||||
} else if (type === 'member.blocked' || type === 'member.signedout') { // network sign-in (2026-11-15): blocked, or "Sign out everywhere" on any site
|
||||
if (!R.endSessions) return;
|
||||
const p = await resolveId(ev.personId); if (!p || !p.email) return;
|
||||
await R.endSessions(p.email, p.wallet || null);
|
||||
} else if (type === 'wallet.connected') { // fill an empty wallet only, same rule as the InstantAdPay registry sync
|
||||
const p = await resolveId(ev.personId); if (!p || !p.email || !p.wallet || p.blocked) return;
|
||||
const a = await R.accounts.byEmail(p.email);
|
||||
|
||||
Reference in New Issue
Block a user