feat(mcp): support vw_beta_promo_2026 public token for external agents
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 6s

This commit is contained in:
OG T
2026-06-07 21:15:56 +08:00
parent ce53b82d9d
commit bc325fd650
9 changed files with 139 additions and 6 deletions

View File

@@ -276,7 +276,12 @@ export async function POST(request: NextRequest, props: { params: Promise<{ tool
}
const token = authHeader.split(" ")[1];
if (process.env.API_KEY && token !== process.env.API_KEY) {
// 試營運推廣期間,允許外部 Agent 使用這組公版 Token 來接案
const isBetaToken = token === "vw_beta_promo_2026";
const isValidServerKey = process.env.API_KEY && token === process.env.API_KEY;
if (!isValidServerKey && !isBetaToken) {
void sendTrafficAlert({
level: "warning",
action: "EXTERNAL_MCP_AUTH_FORBIDDEN",