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 @@ - +