In-game sign-in carries the paid-traffic source: joinedRef = <game host>/<src>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1866,7 +1866,8 @@ const server = http.createServer(async (req, res) => {
|
||||
const code = String(Math.floor(100000 + Math.random() * 900000));
|
||||
emailCodes.set(e, { code, exp: Date.now() + 15 * 60 * 1000, tries: 0, nextAt: Date.now() + 60 * 1000 });
|
||||
const ref = pageTok(b.ref);
|
||||
if (!(await accounts.byEmail(e))) pendingSponsor.set(e, { ref: ref || '', via: String(b.game), joinedRef: g.host() });
|
||||
const srcTag = String(b.src || '').toLowerCase().replace(/[^a-z0-9_.-]/g, '').slice(0, 30); // paid-traffic source the game saw (2026-10-03)
|
||||
if (!(await accounts.byEmail(e))) pendingSponsor.set(e, { ref: ref || '', via: String(b.game), joinedRef: g.host() + (srcTag ? '/' + srcTag : '') });
|
||||
console.log('game-signin code', b.game, e.replace(/^(.).*(@.*)$/, '$1***$2'), ref ? 'ref ' + ref : '');
|
||||
if (mailer.hasKey()) {
|
||||
try { await mailer.sendCode(e, code); } catch (err) { console.error('sendCode failed', err.message); return json(res, 502, { error: 'Could not send the email. Try again in a minute.' }, cors); }
|
||||
@@ -1889,7 +1890,8 @@ const server = http.createServer(async (req, res) => {
|
||||
if (fraud.isSuspended(e)) return json(res, 403, { error: 'This account is suspended. Contact support.' }, cors);
|
||||
const pend = pendingSponsor.get(e);
|
||||
const ref = pageTok(b.ref) || (pend && pend.ref) || '';
|
||||
const via = String(b.game); const joinedRef = (pend && pend.joinedRef) || g.host();
|
||||
const via = String(b.game); const srcTag = String(b.src || '').toLowerCase().replace(/[^a-z0-9_.-]/g, '').slice(0, 30);
|
||||
const joinedRef = (pend && pend.joinedRef) || (g.host() + (srcTag ? '/' + srcTag : '')); // e.g. driprunner.app/adsterra
|
||||
let fraudFlags = [];
|
||||
const existing = await accounts.byEmail(e);
|
||||
if (!existing) { // one account per person, exactly as on the dashboard
|
||||
|
||||
Reference in New Issue
Block a user