Network sign-in: the way back after signing in on InstantAdPay (Marty 2026-11-17)

networksso.js (the shared file, same in every network site): providers now also know every
site in the hub's GET /v1/sso-sites, ?return=<site>&to=/path links on IAP/LinkSpin remember
the way back, a missing wallet sends the member to the provider's wallet step first and then
back, and the deliberate-tap state lives 1 hour (was 20 minutes) so a sign-up has time.
Join links to InstantAdPay carry ?return=<this site>&to=/my.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-17 07:09:35 -06:00
parent adbb59b755
commit c4bdefb8a0
4 changed files with 117 additions and 17 deletions
+4 -1
View File
@@ -196,7 +196,10 @@ function issueTicket(req, page, shownIds, ref, src) {
}
const todayStats = () => { const t = store.today(); return { views: t.views || 0, vclicks: t.vclicks || 0, boosts: t.boosts || 0, ads: store.liveAds().length }; };
// with no ref, the join page without a sponsor: /join/{ref} becomes the site root, ?ref={ref} is dropped
const joinUrl = ref => ref ? C.joinUrl.split('{ref}').join(encodeURIComponent(ref)) : C.joinUrl.replace(/\/join\/\{ref\}.*$/, '/').replace(/[?&]ref=\{ref\}/, '').split('{ref}').join('');
// a join link to InstantAdPay or LinkSpin carries the way back here (2026-11-17, Marty: "it never had a return path back"): the
// provider remembers ?return=<this site>&to=/my and, after the sign-up or sign-in (and the wallet step), sends the member back
const withReturn = url => { try { const x = new URL(url); if (!/^(www\.)?(instantadpay\.com|linkspin\.app)$/.test(x.hostname) && x.origin !== new URL(C.iapBase).origin) return url; x.searchParams.set('return', C.siteId); x.searchParams.set('to', '/my'); return x.toString(); } catch (e) { return url; } };
const joinUrl = ref => withReturn(ref ? C.joinUrl.split('{ref}').join(encodeURIComponent(ref)) : C.joinUrl.replace(/\/join\/\{ref\}.*$/, '/').replace(/[?&]ref=\{ref\}/, '').split('{ref}').join(''));
// tracking macros in an ad link, filled on every click: {clickid} a fresh id, {placement} where it was clicked
const MACRO = /\{(clickid|placement)\}|%7B(clickid|placement)%7D/gi;
function clickLink(a, placement) {