Files
zeekayandHanzo Dev 2c295299ae config: the lists that gate abuse now actually load, from Hanzo KV
@vercel/edge-config read NOTHING in production. EDGE_CONFIG is unset on this
deployment, so every `get()` threw, and every call site caught it and fell back
to an empty default. Several of them additionally checked `process.env.
EDGE_CONFIG` and returned early, so the fallback was not even a fallback — it was
the only path.

What that meant, live:

  emails / keywords  the blacklist matched nothing — abuse filtering was off
  trustedTeams       no team was ever trusted
  betaFeatures       no beta feature was ever on
  customEmail        no team ever got its own sender address

lib/config.ts reads these from Hanzo KV under a `config:` prefix, so a value
changes with a KV write rather than a deploy — which is the reason the app
reached for an edge config service to begin with. Reads never throw: a KV outage
returns the caller's fallback, exactly as these call sites already assumed, so
config can never take down a request path.

customEmail is a Record, not a list, and now says so — it was being read through
the list helper, which would have discarded it.

@vercel/functions and @vercel/edge-config have no importers left and are dropped
from package.json; the lockfile is regenerated and `npm ci --dry-run` is clean.
@vercel/blob still has 10 importers and stays until storage moves to S3.

Verified with npx tsc --noEmit: 100 errors before and after.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-09 10:37:48 -07:00

9 lines
290 B
TypeScript

import { getStringList } from "@/lib/config";
export const isBlacklistedEmail = async (email: string) => {
const blacklistedEmails = await getStringList("emails");
if (blacklistedEmails.length === 0) return false;
return new RegExp(blacklistedEmails.join("|"), "i").test(email);
};