Gate replays.

This commit is contained in:
Mike Cao committed 2026-03-15 18:03:36 -07:00
1 parent 534af98809
commit 6e1a05f686
8 files changed
+109 -6

No files matched your search

+9
View File
@@ -4,6 +4,7 @@ import { z } from 'zod';
import { secret } from '@/lib/crypto';
import { getClientInfo, hasBlockedIp } from '@/lib/detect';
import { parseToken } from '@/lib/jwt';
import { fetchAccount } from '@/lib/load';
import { parseRequest } from '@/lib/request';
import { badRequest, forbidden, json, serverError } from '@/lib/response';
import { getWebsite } from '@/queries/prisma';
@@ -60,6 +61,14 @@ export async function POST(request: Request) {
return json({ ok: false, reason: 'replay_disabled' });
}
if (process.env.CLOUD_MODE) {
const account = await fetchAccount(website.userId);
if (!account?.isBusiness) {
return forbidden({ message: 'Business subscription required.' });
}
}
// Client info for bot/IP checks
const { ip, userAgent } = await getClientInfo(request, {});