Sponsor survives a lost cookie: join page sends its own token with the code request, server remembers it per email for 30 days, framed visitors offered a full window

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-29 09:48:06 -05:00
parent b5baaf27e8
commit a7a15615ec
21 changed files with 1217 additions and 1188 deletions
+1 -1
View File
@@ -189,7 +189,7 @@ window.IAP = (function () {
await formSettled();
for (let i = 0; i < 4; i++) {
const r = await (await fetch('/api/auth/email/start', { method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, fts: FORM_TS, hp_field_x9: hpValue(o.honeypot), pick }) })).json();
body: JSON.stringify({ email, fts: FORM_TS, hp_field_x9: hpValue(o.honeypot), pick, ref: o.ref || null, angle: o.angle || null }) })).json(); // ref = the join page's own link token, so the sponsor survives a lost cookie
if (r.challenge && o.host) { pick = await iconCheck(o.host, r.challenge, r.error); continue; }
if (r.error) throw new Error(r.error);
return r;