diff --git a/networksso.js b/networksso.js
index a446dfa..f523b57 100644
--- a/networksso.js
+++ b/networksso.js
@@ -34,6 +34,8 @@ const enabled = () => SECRET().length >= 32;
const TTL = 60 * 1000; // token life
const SKEW = 30 * 1000; // clock skew allowed between the two servers
const STATE_AGE = 300; // seconds: the state cookie
+const GO_STATE_AGE = 1200; // seconds: the state cookie on a deliberate tap (time to sign in on the provider first, 2026-11-14)
+const BACK_AGE = 1200; // seconds: the provider remembers an unfinished deliberate check while the member signs in
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
@@ -160,9 +162,15 @@ async function handle(req, res, u) {
const c = cookies(req);
if (mode === 'check' && (c['nsso.tried'] || c['nsso.off'])) return go(res, to);
const st = crypto.randomBytes(16).toString('hex');
- const set = [ck('nsso.st', st, STATE_AGE, true), ck('nsso.tried', '1', TRIED_AGE, true)];
+ const set = [ck('nsso.st', st, mode === 'go' ? GO_STATE_AGE : STATE_AGE, true), ck('nsso.tried', '1', TRIED_AGE, true)];
if (mode === 'go' && c['nsso.off']) set.push(ck('nsso.off', '', 0, true));
- return go(res, (from ? from() : C.peerBase()) + '/sso/check?st=' + st + (C.from ? '&r=' + C.self : '') + '&to=' + encodeURIComponent(to), set);
+ return go(res, (from ? from() : C.peerBase()) + '/sso/check?st=' + st + (C.from ? '&r=' + C.self : '') + '&to=' + encodeURIComponent(to) + (mode === 'go' ? '&m=go' : ''), set);
+ }
+ if (p === '/sso/resume') { // signed in on the provider after a deliberate tap: finish the check it was asked for (2026-11-14)
+ const q = new URLSearchParams(cookies(req)['nsso.back'] || '');
+ const clear = [ck('nsso.back', '', 0, true)];
+ if (!/^[a-f0-9]{32}$/.test(q.get('st') || '')) return go(res, C.defaultPath, clear);
+ return go(res, '/sso/check?st=' + q.get('st') + (q.get('r') ? '&r=' + encodeURIComponent(q.get('r')) : '') + '&to=' + encodeURIComponent(safePath(q.get('to'), '/')), clear);
}
if (p === '/sso/check') {
const st = String(u.searchParams.get('st') || '');
@@ -173,7 +181,14 @@ async function handle(req, res, u) {
const none = base + '/sso/in?none=1&to=' + encodeURIComponent(to);
if (!enabled() || !/^[a-f0-9]{32}$/.test(st)) return go(res, none);
let s = null; try { s = await C.member(req); } catch (e) {}
- if (!s || !s.email) { log('check: not signed in here', null, 'for ' + forName); return go(res, none); }
+ if (!s || !s.email) {
+ if (u.searchParams.get('m') === 'go' && !isBot(req)) { // a deliberate tap: sign in here first, then /sso/resume finishes the trip
+ log('check: not signed in here, asking to sign in', null, 'for ' + forName);
+ const back = new URLSearchParams({ st, to }); if (r) back.set('r', r);
+ return go(res, C.signinPath(C.defaultPath), [ck('nsso.back', back.toString(), BACK_AGE, true)]);
+ }
+ log('check: not signed in here', null, 'for ' + forName); return go(res, none);
+ }
let w = null;
if (wb) { try { w = await C.wallet(s); } catch (e) {} if (!w || !WALLET_RE.test(String(w.address || '').toLowerCase())) { log('check: no wallet on the account', s.email, 'for ' + forName); return go(res, none); } }
log('token issued', s.email, 'for ' + forName);
@@ -209,4 +224,7 @@ async function handle(req, res, u) {
return false;
}
-module.exports = { init, handle, enabled, mint, verify, spend, safePath, isBot, offCookie, mask, TTL, NAMES };
+// true when this browser came here from a deliberate network tap and still has to finish it after signing in
+const pendingBack = req => !!cookies(req)['nsso.back'];
+
+module.exports = { init, handle, enabled, pendingBack, mint, verify, spend, safePath, isBot, offCookie, mask, TTL, NAMES };
diff --git a/public/assets/my.js b/public/assets/my.js
index 13be270..f1e8984 100644
--- a/public/assets/my.js
+++ b/public/assets/my.js
@@ -714,6 +714,7 @@
else if (!render.waiting) { render.waiting = true; window.addEventListener('ls:session', () => { render.waiting = false; render(); }, { once: true }); }
}
if (!signedIn) return;
+ if (me.nssoBack && me.username && !render.toNsso) { render.toNsso = true; location.href = '/sso/resume'; return; } // tapped "Sign in with LinkSpin" on another network site while signed out here (2026-11-14)
TANK_HOLD = (!me.memberId && me.tankHold) || null;
if ($('adminLink')) $('adminLink').hidden = !me.isAdmin; // admin portal link, only for ADMIN_EMAIL
// REQUIRED first step (Marty, 2026-09-12): no username, nothing else. The modal cannot be
diff --git a/public/my.html b/public/my.html
index e78cdd0..2ecbe80 100644
--- a/public/my.html
+++ b/public/my.html
@@ -1020,7 +1020,7 @@
-
+