From 1c06c58daf7b84dd94ddb6b72e872b2b9d51c71f Mon Sep 17 00:00:00 2001 From: martbost Date: Sun, 15 Nov 2026 08:02:10 -0600 Subject: [PATCH] Network sign-in for DownlineHydra (2026-11-15): networksso NAMES downlinehydra, wallets.downlinehydra = DH_URL (default https://downlinehydra.com; staging https://dh.saasy.top until the domain switch), /go/downlinehydra. networksso.test ALL PASSED Co-Authored-By: Claude Opus 5.5 --- networksso.js | 2 +- server.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/networksso.js b/networksso.js index 28b9af3..f793737 100644 --- a/networksso.js +++ b/networksso.js @@ -39,7 +39,7 @@ const BACK_AGE = 1200; // seconds: the provider remembers an unf const TRIED_AGE = 1800; // seconds: one silent check per browser per 30 minutes const OFF_AGE = 12 * 3600; // seconds: no silent check after a sign-out on this site const HINT_AGE = 300; // seconds: the email prefill when the member is not here yet -const NAMES = { iap: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', vbb: 'Viral Banner Blitz', viraladblitz: 'ViralAdBlitz' }; // vbb = Viral Banner Blitz, a wallet site like Downline Banners (2026-11-14); viraladblitz = ViralAdBlitz, a wallet site like VBB (2026-11-15) +const NAMES = { iap: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', vbb: 'Viral Banner Blitz', viraladblitz: 'ViralAdBlitz', downlinehydra: 'DownlineHydra' }; // vbb = Viral Banner Blitz, a wallet site like Downline Banners (2026-11-14); viraladblitz = ViralAdBlitz, a wallet site like VBB (2026-11-15); downlinehydra = DownlineHydra (2026-11-15) const WALLET_RE = /^0x[0-9a-f]{40}$/; let C = null; // { self, peer, peerBase(), isProd, dataDir, db, member(req), accept(email, req, v), signIn(email, req, v), landing(to), signinPath(to), defaultPath, diff --git a/server.js b/server.js index c8f9457..fd55170 100644 --- a/server.js +++ b/server.js @@ -64,6 +64,7 @@ const LS_BASE = () => String(process.env.LS_URL || 'https://linkspin.app').repla const BL_BASE = () => String(process.env.BL_URL || 'https://downlinebanners.com').replace(/\/+$/, ''); // Downline Banners (network sign-in by wallet, 2026-11-13) const VBB_BASE = () => String(process.env.VBB_URL || 'https://viralbannerblitz.com').replace(/\/+$/, ''); // Viral Banner Blitz (network sign-in by wallet, 2026-11-14) const VAB_BASE = () => String(process.env.VAB_URL || 'https://viraladblitz.com').replace(/\/+$/, ''); // ViralAdBlitz (network sign-in by wallet, 2026-11-15; VAB_URL = the staging host until the domain switch) +const DH_BASE = () => String(process.env.DH_URL || 'https://downlinehydra.com').replace(/\/+$/, ''); // DownlineHydra (network sign-in, 2026-11-15; DH_URL = https://dh.saasy.top until the domain switch) // Refuel spots (Marty 2026-11-13: paid from the company fee share, $50+): refuel.js calls this once per counted $50+ refuel tx // (either site). Downline Banners buys the spot for the member's main wallet from the engine wallet (its refuelspots.js), with // their network sponsor's wallet as sponsor. Signed with NETWORK_SSO_SECRET ('net.v1.' + ts + newline + raw body). @@ -609,7 +610,7 @@ async function boot() { // only (the admin portal is never shared); an account that is not here yet, or is still a waiting LinkSpin/BTC4Hits account, // gets the normal email-code sign-in with the email filled in, so every new-account check (anti-fraud, sponsor) runs as before. networksso.init({ self: 'iap', peer: 'linkspin', peerBase: LS_BASE, isProd: IS_PROD, dataDir: DATA_DIR, db, defaultPath: '/my', - wallets: { bannerline: BL_BASE, vbb: VBB_BASE, viraladblitz: VAB_BASE }, // Downline Banners members are wallets: vouch for the wallet they signed in with, else the account's linked one + wallets: { bannerline: BL_BASE, vbb: VBB_BASE, viraladblitz: VAB_BASE, downlinehydra: DH_BASE }, // Downline Banners members are wallets: vouch for the wallet they signed in with, else the account's linked one wallet: async s => { const a = await accounts.byEmail(s.email); const addr = String(s.address || (a && a.address) || '').toLowerCase(); return addr ? { address: addr, name: (a && a.username) || '' } : null; }, member: async req => { // a wallet sign-in carries the address, not the email: find the account that owns the wallet (2026-11-13) const s = await auth.fromRequest(req); if (!s) return null; @@ -2369,7 +2370,7 @@ const server = http.createServer(async (req, res) => { res.writeHead(302, { Location: to, 'Cache-Control': 'no-store', 'X-Robots-Tag': 'noindex' }); return res.end(); } } // network sign-in with LinkSpin (2026-11-12): /go/linkspin, /sso/start, /sso/check, /sso/in, /api/sso/status - if (req.method === 'GET' && (p === '/go/linkspin' || p === '/go/bannerline' || p === '/go/vbb' || p === '/go/viraladblitz' || p.startsWith('/sso/') || p === '/api/sso/status') && await networksso.handle(req, res, u)) return; + if (req.method === 'GET' && (p === '/go/linkspin' || p === '/go/bannerline' || p === '/go/vbb' || p === '/go/viraladblitz' || p === '/go/downlinehydra' || p.startsWith('/sso/') || p === '/api/sso/status') && await networksso.handle(req, res, u)) return; // network member lookup for Downline Banners (2026-11-13, Marty: share links use the InstantAdPay username): ?u= -> the // account's linked wallet, ?a= -> the username. Public data only (usernames are public join links, wallets are on-chain). if (req.method === 'GET' && p === '/api/network/member') {