diff --git a/public/assets/my.js b/public/assets/my.js index cf8f520..383922a 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -819,6 +819,8 @@ if (!render.gating) { render.gating = true; showOnboard(true).then(() => { render.gating = false; render(); }); } return; } + // came from a Drip Runner share link: once they have a username, straight back into the game (2026-09-30) + if (me.returnTo === 'driprunner' && !render.toGame) { render.toGame = true; location.href = '/api/my/driprunner'; return; } // arrived from an invite page: run the welcome tour and login ad once if (/[?&]welcome=1/.test(location.search) && !render.welcomed) { render.welcomed = true; diff --git a/public/my.html b/public/my.html index 5fed87e..500b54c 100644 --- a/public/my.html +++ b/public/my.html @@ -1085,7 +1085,7 @@ - + diff --git a/server.js b/server.js index c75e233..5bb1d47 100644 --- a/server.js +++ b/server.js @@ -1317,6 +1317,7 @@ const server = http.createServer(async (req, res) => { const set = []; set.push('iap.sponsor=' + tok + cookieTail); // last touch wins if (u.searchParams.get('from') === 'polhunter') set.push('iap.return=polhunter' + cookieTail); // came through a PolHunter share link: send them back after the wallet step + if (u.searchParams.get('from') === 'driprunner') set.push('iap.return=driprunner; Path=/; SameSite=Lax; Max-Age=7200' + (IS_PROD ? '; Secure' : '')); // a Drip Runner share link: back into the game once they have a username const promo = promos.norm(u.searchParams.get('promo')); if (promo) set.push('iap.promo=' + promo + cookieTail); // partner code, redeemed at signup if (promo) { const pref = String(req.headers.referer || '').replace(/^https?:\/\//, '').split('/')[0].toLowerCase().slice(0, 80); if (pref) set.push('iap.promoref=' + encodeURIComponent(pref) + cookieTail); } // which partner page it came from if (ang) set.push('iap.angle=' + angle + cookieTail); @@ -1326,7 +1327,7 @@ const server = http.createServer(async (req, res) => { // rather than dependent on a header (Marty, 2026-09-24: "not just members that come on board // IAP and work their way over to POL Hunter"). if (!cookies['iap.ref']) { - const host = u.searchParams.get('from') === 'polhunter' ? 'polhunter.com' : coach.refHost(req.headers.referer); + const host = u.searchParams.get('from') === 'polhunter' ? 'polhunter.com' : u.searchParams.get('from') === 'driprunner' ? 'driprunner.saasy.top' : coach.refHost(req.headers.referer); set.push('iap.ref=' + encodeURIComponent(host) + cookieTail); } return serveJoinPage(res, tok, ang ? angle : '', ang, set); @@ -1696,7 +1697,7 @@ const server = http.createServer(async (req, res) => { const _defSpon = Number(siteConfig().defaultSponsorId) || 1; if (!sponsorId && memberId !== _defSpon) sponsorId = _defSpon; // orphan fallback → #1 (never self-sponsor) if (memberId && acct && acct.memberId !== memberId) accounts.setMemberId(acct.email, memberId).catch(() => {}); - const out = { signedIn: true, returnTo: parseCookies(req)['iap.return'] === 'polhunter' ? 'polhunter' : null, sponsorBlocked, sponsorRouted, sponsorName: spdMe.name || null, email: s.email || (acct && acct.email) || null, + const out = { signedIn: true, returnTo: ['polhunter', 'driprunner'].includes(parseCookies(req)['iap.return']) ? parseCookies(req)['iap.return'] : null, sponsorBlocked, sponsorRouted, sponsorName: spdMe.name || null, email: s.email || (acct && acct.email) || null, address: s.address || (acct && acct.address) || null, memberId, username: (acct && acct.username) || null, refCode: (acct && acct.code) || null, sponsorId, @@ -2432,7 +2433,8 @@ const server = http.createServer(async (req, res) => { if (DR_SECRET().length < 32) return json(res, 503, { error: 'Drip Runner is not connected yet.' }); const acct = await accounts.byEmail(s.email); const memberId = (acct && acct.memberId) || s.memberId || 0; - const tok = drMint({ memberId: Number(memberId), email: s.email, wallet: (acct && acct.address) || s.address || null, username: (acct && acct.username) || null }); + const tok = drMint({ memberId: Number(memberId), email: s.email, wallet: (acct && acct.address) || s.address || null, username: (acct && acct.username) || null, + sponsorRef: (acct && acct.sponsorRef) || null, joinedRef: (acct && acct.joinedRef) || null, joinedAt: (acct && acct.created) || null }); // the game credits referrals to the IAP sponsor res.writeHead(302, { Location: DR_URL() + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': 'iap.return=; Path=/; SameSite=Lax; Max-Age=0' + (IS_PROD ? '; Secure' : '') }); return res.end(); } // -- Drip Runner refuel: a real verified visit (advertiser charged as usual); the player gets fuel, not credits