From 856dbcb8d3f73abb6ef2d26fddfd114c461d6c5d Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 20 Nov 2026 07:31:18 -0600 Subject: [PATCH] Sign-in: InstantAdPay as the fallback when the hub has no sign-in for the browser (from: { iap }, NETWORK_SSO_SECRET set), so "Sign in with your network account" no longer bounces straight back to /my (Marty 2026-11-20) Co-Authored-By: Claude Opus 5.5 --- server.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index 2020bde..da43d19 100644 --- a/server.js +++ b/server.js @@ -197,13 +197,16 @@ const chatbot = require('./chatbot'); const legal = require('./legal'); const chatJson = (res, code, obj, extra) => { res.writeHead(code, Object.assign({ 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff' }, extra || {})); res.end(JSON.stringify(obj)); }; // My Stack POL (Marty approved 2026-11-19): the network sign-in through the hub (networksso.js, the shared file; HUB_SSO=on with -// HUB_URL, HUB_SECRET, HUB_SITE=stackpol) and the signed-in area at /my (my.js). Nothing public needs it. Hub only: no -// NETWORK_SSO_SECRET here, so the old pairwise IAP/LinkSpin path stays off (and no `from`: members are emails, like the hub's). +// HUB_URL, HUB_SECRET, HUB_SITE=stackpol) and the signed-in area at /my (my.js). Nothing public needs it. +// InstantAdPay as the fallback (Marty 2026-11-20: "you click on it ... and it never goes anywhere"): with only the hub, a browser +// the hub has no sign-in for came straight back to /my. NETWORK_SSO_SECRET (the same as IAP's) turns on the pairwise path the other +// rebuilt sites use, and `from: { iap }` makes the hop name this site (&r=stackpol) so InstantAdPay signs the member in and sends +// them back here, not to its own peer LinkSpin. const networksso = require('./networksso'); const my = require('./my'); const IAP_BASE = String(process.env.IAP_URL || 'https://instantadpay.com').trim().replace(/\/+$/, ''); my.init({ idx: () => IDX, PROGRAMS, BY_KEY, head, tail, esc, fmt, fmtInt, when, ledgerRows, tableHead, SITE, dataDir: DATA_DIR, qr: !!QR }); -networksso.init({ self: 'stackpol', peer: 'iap', peerBase: () => IAP_BASE, isProd: /^https:/.test(SITE), dataDir: DATA_DIR, defaultPath: '/my', +networksso.init({ self: 'stackpol', peer: 'iap', peerBase: () => IAP_BASE, from: { iap: () => IAP_BASE }, isProd: /^https:/.test(SITE), dataDir: DATA_DIR, defaultPath: '/my', member: async req => { const s = my.session(req); return s ? { email: s.email, address: s.address } : null; }, accept: async email => (email ? { ok: true } : { fallback: 'no email' }), // the hub vouches for a network member; Stack POL keeps no accounts signIn: async (email, req, v) => my.mintSession({ email, wallet: v && v.wallet, name: v && v.name }),