Network sign-in: the way back to every network site (Marty 2026-11-17: "I just logged in to Instant Ad Pay from Viral Ad Source, and it never had a return path back")

Root cause: IAP's networksso `wallets` list was hand-written and had no ViralAdSource line, so
/sso/check?r=viraladsource was refused ("unknown site asking") and the browser was sent to the
IAP dashboard: a signed-out visitor to viraladsource.com/my was even dropped there by the silent
check, and a signed-in IAP member could never be signed in on ViralAdSource through IAP.
- networksso.js: providers also answer every site in the hub's GET /v1/sso-sites; ?return=<site>
  &to=/path links remember the way back (nsso.ret, known sites only); /sso/resume finishes it
  after the code sign-in; a wallet site with no wallet on the account goes to the Wallet tab
  first (nsso.wait, no bounce loop) and the wallet link answers next: /sso/resume; the tap state
  lives 1 hour.
- server.js: every /go/<site> and ?return= request goes to networksso (no per-site list; fivex
  was missing from it too); walletPath /my#wallet; /api/me nssoBackTo; wallet link next/backTo.
- my.js: "Taking you back to <site>" after the wallet link; one line on the Wallet tab while a
  site waits for the wallet. my.js?v=20261117back.
- qa/networksso-return.e2e.mjs: hub-only site, silent check, tap, wallet step, return links,
  no open redirect. All network sign-in suites and iap-qa member pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-17 07:21:19 -06:00
parent 71e2e2b487
commit 72160c6a10
5 changed files with 315 additions and 21 deletions
+3 -2
View File
@@ -990,6 +990,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if (me.returnTo === 'spookydoors' && !render.toGame) { render.toGame = true; location.href = '/api/my/spookydoors'; return; } // Spooky Doors sent them here to sign in (2026-10-02)
if (me.returnTo === 'polybreak' && !render.toGame) { render.toGame = true; location.href = '/api/my/polybreak'; return; } // PolyBreak sent them here to sign in (2026-10-13)
if (me.returnTo === 'nsso' && !render.toGame) { render.toGame = true; location.href = '/sso/resume'; return; } // tapped "Sign in with InstantAdPay" on another network site while signed out here (2026-11-14)
if (me.nssoBackTo && !me.nssoBack && !me.address && !render.walletAsk) { render.walletAsk = true; setTimeout(() => IAP.status(me.nssoBackTo + ' signs you in with your wallet. Link it here on the Wallet tab (one free signature) and you go straight back to ' + me.nssoBackTo + '.'), 2500); } // after the sign-in toasts (daily bonus), and it stays up // waiting on the wallet step (2026-11-17)
if (me.returnTo === 'forum' && !render.toGame) { render.toGame = true; location.href = '/api/my/forum'; return; } // Earners Corner forum sign-in (2026-11-10)
if (me.returnTo === 'polminer' && !render.toGame) { render.toGame = true; location.href = '/api/my/polminer'; return; } // POL Miner sent them here to sign in (2026-10-28)
if (me.returnTo === 'warpwares' && !render.toGame) { render.toGame = true; location.href = '/api/my/warpwares'; return; } // Warp & Wares sent them here to sign in (2026-10-29)
@@ -1019,7 +1020,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
setPane(location.hash.slice(1) || 'overview');
$('campGate').hidden = !!me.memberId;
$('earnGate').hidden = !!me.memberId;
if (me.username && !me.address) { let shown = ''; try { shown = sessionStorage.getItem('iap.gs.walletHint'); sessionStorage.setItem('iap.gs.walletHint', '1'); } catch (e) {} if (shown !== '1') setTimeout(() => IAP.status('Next step when you are ready: link your wallet so your payouts have somewhere to land. The Getting started card at the top shows how.', 'ok'), 1200); }
if (me.username && !me.address && !render.walletAsk) { let shown = ''; try { shown = sessionStorage.getItem('iap.gs.walletHint'); sessionStorage.setItem('iap.gs.walletHint', '1'); } catch (e) {} if (shown !== '1') setTimeout(() => IAP.status('Next step when you are ready: link your wallet so your payouts have somewhere to land. The Getting started card at the top shows how.', 'ok'), 1200); }
loadDashboard();
if (window.IAPSupport) IAPSupport.badge(); // Help badge: Marty replied to a ticket
@@ -3433,7 +3434,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
$('linkBtn').addEventListener('click', busy($('linkBtn'), async () => {
IAP.status('Check your wallet for the free link signature…');
const lr = await IAPWallet.signIn(); // server binds the wallet to the signed-in email account
if (lr && lr.next) { IAP.status('Wallet linked. Taking you back to PolHunter…', 'ok'); setTimeout(() => { location.href = lr.next; }, 700); return; } // they came from PolHunter: close the loop
if (lr && lr.next) { IAP.status('Wallet linked. Taking you back to ' + (lr.backTo || 'PolHunter') + '…', 'ok'); setTimeout(() => { location.href = lr.next; }, 700); return; } // they came from PolHunter or another network site: close the loop (2026-11-17)
IAP.status('Wallet linked. Earnings pay there from now on.', 'ok');
await render();
}));
+1 -1
View File
@@ -1312,7 +1312,7 @@
<script src="/assets/promo.js?v=20261103gp"></script>
<script src="/assets/support.js?v=20261116sg"></script>
<script src="/assets/netkits.js?v=20261117vas"></script>
<script src="/assets/my.js?v=20261115hub"></script>
<script src="/assets/my.js?v=20261117back"></script>
<script src="/assets/fuel.js?v=20261113sso"></script><script src="/assets/tankfeed.js?v=20261115tb"></script>
<script src="/assets/engine-room.js?v=20261113sso"></script>
<script src="/assets/netsso.js?v=20261113sso"></script>