Refused hand-offs (not a tester) are logged and pinged to Marty with the name to add
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,7 @@ async function notify(kind, p) {
|
|||||||
if (kind === 'paid') return telegram('\u{1F3AE} <b>Drip Runner</b> · paid ' + who + ' <b>' + fmt(p.pol) + ' POL</b> · <a href="' + explorer() + '/tx/' + p.tx + '">verify</a>');
|
if (kind === 'paid') return telegram('\u{1F3AE} <b>Drip Runner</b> · paid ' + who + ' <b>' + fmt(p.pol) + ' POL</b> · <a href="' + explorer() + '/tx/' + p.tx + '">verify</a>');
|
||||||
if (kind === 'failed') return telegram('❌ <b>Drip Runner</b> · payout to ' + who + ' failed: ' + p.error);
|
if (kind === 'failed') return telegram('❌ <b>Drip Runner</b> · payout to ' + who + ' failed: ' + p.error);
|
||||||
if (kind === 'low') return telegram('⚠️ <b>Drip Runner wallet is low</b>: ' + fmt(p.balance) + ' POL in ' + p.address + ' (needs ' + fmt(p.threshold) + ').');
|
if (kind === 'low') return telegram('⚠️ <b>Drip Runner wallet is low</b>: ' + fmt(p.balance) + ' POL in ' + p.address + ' (needs ' + fmt(p.threshold) + ').');
|
||||||
|
if (kind === 'refused') return telegram('\u{1F6AB} <b>Drip Runner</b> \u00b7 ' + who + ' (' + p.email + ') tried to sign in but is not on the tester list. Add them under Admin > Settings > Testers: ' + SITE + '/admin');
|
||||||
if (kind === 'signin') return telegram('\u{1F44B} <b>Drip Runner</b> · first sign-in: ' + who + ' (' + (p.wallet ? 'wallet on file' : 'NO wallet yet') + ')');
|
if (kind === 'signin') return telegram('\u{1F44B} <b>Drip Runner</b> · first sign-in: ' + who + ' (' + (p.wallet ? 'wallet on file' : 'NO wallet yet') + ')');
|
||||||
if (kind === 'refuel') return telegram('⛽ <b>Drip Runner</b> · ' + who + ' refuelled on campaign #' + p.campaignId + ': +' + fmt(p.pol) + ' POL to the pool (' + p.credits + ' credits, $' + p.share + ' share)');
|
if (kind === 'refuel') return telegram('⛽ <b>Drip Runner</b> · ' + who + ' refuelled on campaign #' + p.campaignId + ': +' + fmt(p.pol) + ' POL to the pool (' + p.credits + ' credits, $' + p.share + ' share)');
|
||||||
return false;
|
return false;
|
||||||
@@ -118,6 +119,7 @@ const server = http.createServer(async (req, res) => {
|
|||||||
if (p === '/auth') {
|
if (p === '/auth') {
|
||||||
const r = sso.verify(u.searchParams.get('t'));
|
const r = sso.verify(u.searchParams.get('t'));
|
||||||
if (r.error) return page(res, 400, 'Sign-in did not work', '<p>' + esc(r.error) + '</p><p><a class="btn" href="' + IAP + '/api/my/driprunner">Try again from InstantAdPay</a></p>');
|
if (r.error) return page(res, 400, 'Sign-in did not work', '<p>' + esc(r.error) + '</p><p><a class="btn" href="' + IAP + '/api/my/driprunner">Try again from InstantAdPay</a></p>');
|
||||||
|
if (!allowed(r.claims)) { console.log('hand-off refused: not a tester', r.claims.memberId, r.claims.username || '', String(r.claims.email || '').replace(/^(.).*(@.*)$/, '$1***$2')); notify('refused', { memberId: r.claims.memberId, username: r.claims.username, email: r.claims.email }).catch(() => {}); }
|
||||||
if (!allowed(r.claims)) return page(res, 403, 'Not on the tester list yet', '<p>Drip Runner is in a closed trial. Your InstantAdPay account (' + esc(r.claims.username ? '@' + r.claims.username : '#' + r.claims.memberId) + ') is not on the tester list. Ask Marty to add you.</p>');
|
if (!allowed(r.claims)) return page(res, 403, 'Not on the tester list yet', '<p>Drip Runner is in a closed trial. Your InstantAdPay account (' + esc(r.claims.username ? '@' + r.claims.username : '#' + r.claims.memberId) + ') is not on the tester list. Ask Marty to add you.</p>');
|
||||||
const existing = sso.fromRequest(req);
|
const existing = sso.fromRequest(req);
|
||||||
let sid;
|
let sid;
|
||||||
|
|||||||
Reference in New Issue
Block a user