Sign-in guard: measure form age on the visitor's own clock (fage) so a device with a fast clock is not refused forever

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-07 04:26:58 -05:00
parent 28b90dcae4
commit 5c31f4540c
25 changed files with 3570 additions and 3566 deletions
+1 -1
View File
@@ -62,7 +62,7 @@
if (f && f.email) { email = String(f.email.value || '').trim(); newsletter = !!(f.nl && f.nl.checked); }
if (!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(email)) return err('Enter the email you use (or want to use) for InstantAdPay.');
err(''); busy(true);
post('/api/game/auth/start', { game: game, email: email, ref: ref, src: src, fts: fts, hp_field_x9: (f && f.hp_field_x9 && f.hp_field_x9.value) || '', pick: pick || '', dev: devId() }).then(function (r) {
post('/api/game/auth/start', { game: game, email: email, ref: ref, src: src, fts: fts, fage: Date.now() - fts, hp_field_x9: (f && f.hp_field_x9 && f.hp_field_x9.value) || '', pick: pick || '', dev: devId() }).then(function (r) {
busy(false);
if (r.challenge) return stepChallenge(r.challenge, r.error);
if (r.ok) { resendAt = Date.now() + 60000; return stepCode(r.devCode); }