Tester list also matches the IAP username

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-30 14:32:45 -05:00
parent ecfe97b90a
commit fad0767648
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -37,7 +37,7 @@
<div><label>Drip magnet (drips)</label><input name="item_magnet" type="number" step="1" min="0"></div>
<div><label>Courier Mk II (drips)</label><input name="item_ship" type="number" step="1" min="0"></div>
</div>
<label>Testers (one per line: IAP email or member id)</label>
<label>Testers (one per line: IAP username, email or member id)</label>
<textarea name="testers" rows="6"></textarea>
<p style="margin-top:10px"><button class="btn" type="submit">Save settings</button> <span class="muted" id="saveOut"></span></p>
</form>
+1 -1
View File
@@ -93,7 +93,7 @@ function allowed(claims, req) {
const s = ledger.settings(); const mode = String(process.env.DR_SIGNUPS || s.signups || 'testers');
if (mode === 'open') return true; if (mode === 'closed') return false;
const list = (s.testers || []).map(x => String(x).trim().toLowerCase()).filter(Boolean);
if (list.includes(String(claims.email || '').toLowerCase()) || list.includes(String(claims.memberId))) return true;
if (list.includes(String(claims.email || '').toLowerCase()) || list.includes(String(claims.memberId)) || (claims.username && list.includes(String(claims.username).toLowerCase()))) return true; // email, member id or IAP username
return mode === 'key' && req && hasPass(req);
}
// the IAP -> game callback is signed over the timestamp and the raw body with the shared secret