Reserve company and staff usernames; Terms: usernames must not mislead

setUsername refuses names containing our brands (instantadpay, polhunter,
rmcircle, cryptoteambuild, linkspin, dripoffers, adrevlnks...) and staff or
authority words on their own (admin, support, official, staff, moderator,
owner, ceo, payouts...). Terms section 3 gains the matching rule.
Prompted by #170 'instantadpay' and #172 'admin' (same person), 2026-09-27.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-27 05:02:35 -05:00
parent 7873d752d3
commit 917e87cd32
2 changed files with 58 additions and 44 deletions
+14 -1
View File
@@ -411,10 +411,23 @@ async function byUsername(u) {
const n = normUser(u);
return USER_RE.test(n) ? impl().byUsername(n) : null;
}
// Usernames that pass a member off as the company, its staff or its other sites (Marty, 2026-09-27:
// member #170 took "instantadpay" and a second account of theirs took "admin", then adopted
// holding-tank members under the company's name). Anything that contains a brand, or is a staff
// or authority word on its own (with digits, underscores or team/desk/help around it), is refused.
const BRANDS = ['instantadpay', 'instant_ad_pay', 'instantadspay', 'polhunter', 'rmcircle', 'cryptoteambuild', 'linkspin', 'dripoffers', 'adrevlnks', 'adrevsplit', 'faucetwave', 'tieroneads', 'tier1ads'];
const ROLE_RE = /^[_\d]*(the_?|iap_?|ctb_?|team_?|official_?)?(admin|admins|administrator|sysadmin|root|system|support|helpdesk|help|staff|official|moderator|mod|mods|owner|ceo|founder|cofounder|company|house|security|billing|payout|payouts|payment|payments|compliance|legal|noreply|no_reply|info|contact|service|verify|verification|iap|ctb)[_\d]*(_?(team|desk|help|official|staff|support|center|centre))?[_\d]*$/;
function reservedUsername(n) {
const u = String(n || '').toLowerCase();
const flat = u.replace(/_/g, '');
if (BRANDS.some(b => flat.includes(b.replace(/_/g, '')))) return true;
return ROLE_RE.test(u);
}
async function setUsername(email, username) {
const n = normUser(username);
if (!USER_RE.test(n)) return { error: 'Usernames are 3 to 20 letters, numbers, or underscores.' };
if (/^\d+$/.test(n)) return { error: 'Usernames need at least one letter.' }; // keep /join/<number> unambiguous
if (reservedUsername(n)) return { error: 'That username is reserved. Names that suggest you are InstantAdPay, our staff or one of our sites are not allowed. Please pick another.' };
return impl().setUsername(normEmail(email), n);
}
async function setMemberId(email, id) { return impl().setMemberId(normEmail(email), Number(id) || 0); }
@@ -479,7 +492,7 @@ async function getChatSettings(email) {
}
module.exports = { init, signup, login, ensure, byEmail, byAddress, byCode, byUsername, byMemberId: id => impl().byMemberId(Number(id) || 0), listAll, identities, setSponsorRef,
setUsername, setMemberId, namesForMembers, listByReferrer, downline, linkWallet, count,
setUsername, reservedUsername, setMemberId, namesForMembers, listByReferrer, downline, linkWallet, count,
setLineBanner: (e, b, t) => impl().setLineBanner(String(e || '').toLowerCase(), b, t),
setWallOffers: (e, j) => impl().setWallOffers(String(e || '').toLowerCase(), j),
setProfile: (e, a, bio, socials) => impl().setProfile(String(e || '').toLowerCase(), a, bio, socials),