From 2c27dbc6e4168aa648a761b30fc4795d34ceab74 Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 13 Nov 2026 05:16:37 -0600 Subject: [PATCH] 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 --- networksso.js | 2 +- public/assets/home.js | 11 +++++++++++ public/index.html | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/networksso.js b/networksso.js index c886b0f..6f08e6c 100644 --- a/networksso.js +++ b/networksso.js @@ -172,7 +172,7 @@ async function handle(req, res, u) { if (!cookie) { log('fallback to email code: session not made', v.email); return go(res, C.signinPath(v.to), set); } set.push(cookie); if (c['nsso.off']) set.push(ck('nsso.off', '', 0, true)); log('signed in from ' + peerName, v.email); - return go(res, C.landing(v.to), set); + return go(res, C.landing(v.to === '/' ? C.defaultPath : v.to), set); // no page named: the dashboard, not the public home page (2026-11-13) } if (p === '/api/sso/status') { const c = cookies(req); const set = []; diff --git a/public/assets/home.js b/public/assets/home.js index 15b815f..7bf9221 100644 --- a/public/assets/home.js +++ b/public/assets/home.js @@ -89,3 +89,14 @@ finally { $('verifyBtn').disabled = false; } }); })(); + +// Signed in already (an email code here, or network sign-in from InstantAdPay): the header buttons open the dashboard instead of +// offering Sign in / Start free again (Marty 2026-11-13: arrived signed in from InstantAdPay and the home page still said Sign in) +(function () { + fetch('/api/me', { credentials: 'same-origin', cache: 'no-store' }).then(r => r.json()).then(me => { + if (!me || !me.signedIn) return; + const btns = document.querySelectorAll('header [data-join]'); + if (btns.length) { btns[0].textContent = 'Open my dashboard'; btns[0].href = '/ads'; btns[0].removeAttribute('data-join'); btns[0].className = 'btn pri'; } + for (let i = 1; i < btns.length; i++) btns[i].hidden = true; + }).catch(() => {}); +})(); diff --git a/public/index.html b/public/index.html index df2978c..990d908 100644 --- a/public/index.html +++ b/public/index.html @@ -224,6 +224,6 @@ - +