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 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 05:09:56 -06:00
parent a20e5a772e
commit 3c8fc1802d
+4 -1
View File
@@ -637,7 +637,10 @@ async function boot() {
// sessions only (the admin portal is never shared). An email that is not here yet (the 2-minute sync has not run) or is not
// let in (LS_TESTERS) gets the normal email-code sign-in with the email filled in; nothing is created by the network sign-in.
networksso.init({ self: 'linkspin', peer: 'iap', peerBase: IAP_BASE, isProd: IS_PROD, dataDir: DATA_DIR, db, defaultPath: '/ads',
member: async req => { const s = await auth.fromRequest(req); return s && 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 ? Object.assign({}, s, { email }) : null; },
accept: async email => {
const a = await accounts.byEmail(email);
if (!a) return { fallback: 'no account here yet' };