From ff2f668583b2fce6fc640b4af9d53b4a32afe2e8 Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 13 Nov 2026 05:09:53 -0600 Subject: [PATCH] Network sign-in: a wallet-only session counts as signed in when its wallet belongs to an account (session carries the address, not the email), so a member who signed in with their wallet is signed in on the other site too (Marty 2026-11-13: signed in on IAP, LinkSpin's check came back 'not signed in here'). networksso.test + e2e ALL PASSED. Co-Authored-By: Claude Opus 5.5 --- server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 40b7a84..cd4f2d6 100644 --- a/server.js +++ b/server.js @@ -568,7 +568,10 @@ 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', - member: async req => { const s = await auth.fromRequest(req); return s && s.email && !fraud.isSuspended(s.email) ? s : 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; + let email = s.email || null; if (!email && s.address) { try { const a = await accounts.byAddress(s.address); if (a && a.email) email = a.email; } catch (e) {} } + return email && !fraud.isSuspended(email) ? Object.assign({}, s, { email }) : null; }, accept: async email => { const a = await accounts.byEmail(email); if (!a) return { fallback: 'no account here yet' };