diff --git a/ads.js b/ads.js index 22324e7..f980759 100644 Binary files a/ads.js and b/ads.js differ diff --git a/server.js b/server.js index b512e28..ec3272d 100644 --- a/server.js +++ b/server.js @@ -822,7 +822,7 @@ const server = http.createServer(async (req, res) => { if (!t || t.token !== String(u.searchParams.get('token') || '')) return json(res, 400, { error: 'That view is no longer open. Head back to the dashboard and load the next ad.' }); return json(res, 200, { targetUrl: t.targetUrl, adName: t.adName || null, - dwell: ads.rates().viewDwellSeconds || 5 }); + dwell: ads.rates().viewDwellSeconds || 10 }); } // human check: handed out only once the dwell has elapsed on the SERVER clock if (p === '/api/my/viewchallenge' && req.method === 'GET') { @@ -831,7 +831,7 @@ const server = http.createServer(async (req, res) => { const t = earnTokens.get(s.email); if (!t || t.token !== String(u.searchParams.get('token') || '')) return json(res, 400, { error: 'That view is no longer open.' }); - const dwellMs = (ads.rates().viewDwellSeconds || 5) * 1000; + const dwellMs = (ads.rates().viewDwellSeconds || 10) * 1000; const age = Date.now() - t.ts; if (age < dwellMs - 400) return json(res, 200, { early: true, wait: Math.ceil((dwellMs - age) / 1000) }); if (age > 5 * 60 * 1000) { earnTokens.delete(s.email); return json(res, 400, { error: 'That ad went stale. Load a fresh one.' }); } @@ -845,7 +845,7 @@ const server = http.createServer(async (req, res) => { if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' }); const b = await readBody(req); const t = earnTokens.get(s.email); - const dwellMs = (ads.rates().viewDwellSeconds || 5) * 1000; + const dwellMs = (ads.rates().viewDwellSeconds || 10) * 1000; if (!t || t.token !== String(b.token || '')) return json(res, 400, { error: 'That view did not check out. Load the next ad and let it finish.' }); const age = Date.now() - t.ts; if (age < dwellMs - 400) return json(res, 400, { error: 'Watch the full ad first.' });