Welcome back bonus: +250 earned credits on the first sign-in after 7+ days away (settings comebackBonus/comebackDays)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-05 08:28:54 -05:00
parent 503a252fc8
commit ec57a926fc
4 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -3456,7 +3456,8 @@ const server = http.createServer(async (req, res) => {
if (p === '/api/my/login-bonus' && req.method === 'POST') {
const s = await auth.fromRequest(req);
if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
return json(res, 200, await ads.grantLoginBonus(s.email));
const cfg = siteConfig(); // comebackBonus (250) after comebackDays (7) away; 0 switches it off
return json(res, 200, await ads.grantLoginBonus(s.email, { comeback: cfg.comebackBonus == null ? 250 : Number(cfg.comebackBonus), comebackDays: cfg.comebackDays == null ? 7 : Number(cfg.comebackDays) }));
}
// -- rehearsal test-POL faucet: top a connected wallet up to 10 test-POL
// (anvil_setBalance, no key needed). Rehearsal-only, rate-limited.