11 Commits

Author SHA1 Message Date
martbost e0ece93e9d Network sign-in: the way back to every network site (Marty 2026-11-17)
networksso.js now also answers every site in the hub's GET /v1/sso-sites (the hand-written list
missed sites, the ViralAdSource bug), ?return=<site>&to=/path links remember the way back and
/sso/resume finishes it after the sign-in, and the deliberate-tap state lives 1 hour. Every
/go/<site> and ?return= request goes to networksso (no per-site line in server.js any more).
qa/networksso-return.e2e.mjs: a hub-only site, silent check, tap, wallet step, return links,
no open redirect. All network sign-in suites pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:10:17 -06:00
martbost 1db7699e25 Hub activity from every signed-in LinkSpin use (Marty 2026-11-16: "LinkSpin never reports activity", DownlineHydra Wake it)
The page-load ping (networksso.page) only fires on a full top-level navigation with Sec-Fetch-Dest: document and a
member session that carries an email. It never fired for a Control Room tab kept open (client-side moves and the
/api/my/ping heartbeat), browsers that send no Sec-Fetch headers, wallet-only sessions, or the owner working in the
admin portal. Live finding: Marty has had no LinkSpin member session since 2026-11-15 20:20 UTC, before the ping
shipped (b2669cf, 21:36 UTC); 16 other members already had linkspin rows.
- networksso.seen(s): the same once-a-day ping for any signed-in request; called from /api/me (email or wallet),
  the dashboard heartbeat /api/my/ping and the admin portal page (/admin, the owner's email; hub activity only,
  the admin session is never shared).
- qa/networksso-activity.test.mjs (13 checks, real hub, in run.sh sso + member): a signed-in page load records
  site linkspin, once a day, never API/assets/bots/fetches/signed-out, seen() for an open tab and a wallet session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 07:28:12 -06:00
martbost b2669cfed7 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>
2026-11-15 15:36:06 -06:00
martbost 73bee6c826 Login ad on a clock, hop back to the asking site, 5xYourTeam in the wallets map, signed-out login slot refused (Marty 2026-11-15)
Login ad: every Control Room page asks (cr-shell.js loginAd, the per-tab sessionStorage guard is gone); the server answers with an ad only when the member's last finished view on LinkSpin is older than loginAdEveryHours (site setting, default 3). loginadclock.js (the same file as InstantAdPay), MySQL table login_ad_views through DOCSTORE_URL. POST /api/ads/login/seen at the end of the countdown restarts the clock only if the serve was dwell-2 s earlier. Member erase forgets the row. Admin site setting label.
Signed out: /api/ads/slot?type=login draws nothing and counts no view (bots, probes, previews cannot run up an advertiser's numbers).
Hop: a member who signed in here because another network site asked ("Sign in with LinkSpin", nsso.back) goes back there after the login ad (/sso/resume), from every Control Room screen, not only the retired /my.
networksso.js: the network-wide copy (loop guard 120 s, fivex, unknown r refused); fivex added to the wallets map (FIVEX_URL, default https://5xyourteam.com).
Tests: qa/networksso-partner.e2e.mjs (same file as InstantAdPay, in run.sh): partner via LinkSpin, LinkSpin clock, signed-out slot; networksso e2e retries a keep-alive ECONNRESET. qa sso: ALL PASSED; qa member: ALL PASSED (2 known warnings; networksso e2e flaked on ECONNRESET once, passes with the retry).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:03:14 -06:00
martbost b2b670df14 Network sign-in for DownlineHydra (2026-11-15, same change as InstantAdPay 1c06c58): networksso NAMES downlinehydra (same file as IAP), wallets.downlinehydra = DH_URL (default https://downlinehydra.com; staging https://dh.saasy.top until the domain switch), /go/downlinehydra and /go/viraladblitz hops
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:39:12 -06:00
martbost e23d9ecbdb ViralAdBlitz as a network site (2026-11-15): network sign-in by wallet to ViralAdBlitz (networksso wallets.viraladblitz = VAB_URL, default https://viraladblitz.com; NAMES viraladblitz), fixed network link nwvab -> https://viraladblitz.com/{s2}?ref={s1} on the admin account, catalog network template viraladblitz + NET_SRC vab/viraladblitz (merged by hand beside d6e8de3's dh entry), netsites CODES viraladblitz: nwvab. qa: netsrc 17/17 (seven network links), partner-dhlinks 13/13. LOCAL ONLY.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 06:06:31 -06:00
martbost 836332b5ed Network sign-in: a deliberate 'Sign in with InstantAdPay/LinkSpin' tap while signed out on the provider now asks for the provider's sign-in, then finishes the trip (/sso/resume), instead of bouncing back silently (Marty 2026-11-14: VBB sign-in did nothing)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:31:51 -06:00
martbost 9c4a6458f6 Network sign-in for Viral Banner Blitz (2026-11-14): vbb listed under networksso wallets (VBB_URL, default https://viralbannerblitz.com), so "Sign in with LinkSpin" works on VBB the way it does on Downline Banners; NAMES gains vbb (same networksso.js as IAP, DLB, VBB). networksso unit + e2e: ALL PASSED
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 08:16:26 -06:00
martbost 138c98ccec Network sign-in: same networksso.js as InstantAdPay (wallet sites); LinkSpin vouches for Downline Banners by wallet (2026-11-13)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 07:35:18 -06:00
martbost 2c27dbc6e4 Network sign-in landing (Marty 2026-11-13, Android Chrome: signed in on LinkSpin via InstantAdPay but landed on the public home page, which always says Sign in): a hop with no page named lands on the member dashboard (LinkSpin /ads, InstantAdPay /my); LinkSpin's home page turns Sign in into 'Open my dashboard' for a signed-in visitor (home.js?v=20261113me). networksso.test + e2e ALL PASSED.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 05:16:37 -06:00
martbost e79d5ae63e Network sign-in with InstantAdPay (Marty approved 2026-11-12): signed in on one site = signed in on the other, no email code
networksso.js (same file in both repos): /go/iap hop for signed-in members' cross-site links; /sso/start (state cookie +
30-minute loop guard) -> InstantAdPay /sso/check -> /sso/in?t=<v1 HMAC-SHA256 token, NETWORK_SSO_SECRET, 60 s, single-use nonce,
bound to the browser's state cookie, email, audience and a same-site relative path>. App host only (not link/pages hosts).
Member sessions only (admin portal never shared), ordinary 4-hour session. An email not here yet (sync not run) or not on
LS_TESTERS gets the normal email-code sign-in, email prefilled; nothing is created. Silent check on every Control Room screen
(cr-shell.js loads public/assets/netsso.js); never for bots/fetches; sign-out pauses it 12 hours. Engine Room, Fuel and the
arrival strip's Back to InstantAdPay go through /go/iap. Chatbot knows it (KNOWLEDGE_DATE 2026-11-12). Off until
NETWORK_SSO_SECRET (32+ chars) is set. ?v= bumped (cr-shell, fuel, engine-room: 20261112sso).

qa: networksso.test.cjs all passed, networksso.e2e.mjs (both servers, real browser) 31/31, run.sh member green (0 bugs)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:05:51 -06:00