diff --git a/api/discord/interactions.ts b/api/discord/interactions.ts index 74f1410a..97f2dc91 100644 --- a/api/discord/interactions.ts +++ b/api/discord/interactions.ts @@ -4,7 +4,10 @@ import { createVerify } from "crypto"; export default function handler(req: VercelRequest, res: VercelResponse) { res.setHeader("Access-Control-Allow-Origin", "*"); res.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS"); - res.setHeader("Access-Control-Allow-Headers", "Content-Type, x-signature-ed25519, x-signature-timestamp"); + res.setHeader( + "Access-Control-Allow-Headers", + "Content-Type, x-signature-ed25519, x-signature-timestamp", + ); if (req.method === "OPTIONS") { return res.status(200).end(); @@ -20,7 +23,9 @@ export default function handler(req: VercelRequest, res: VercelResponse) { const rawPublicKey = process.env.DISCORD_PUBLIC_KEY; if (!signature || !timestamp || !rawPublicKey) { - return res.status(401).json({ error: "Missing required headers or public key" }); + return res + .status(401) + .json({ error: "Missing required headers or public key" }); } // Reconstruct the raw body diff --git a/api/roblox-callback.ts b/api/roblox-callback.ts index b4a3b2fa..319a2de8 100644 --- a/api/roblox-callback.ts +++ b/api/roblox-callback.ts @@ -13,7 +13,9 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { try { const shared = - process.env.ROBLOX_SHARED_SECRET || process.env.ROBLOX_WEBHOOK_SECRET || ""; + process.env.ROBLOX_SHARED_SECRET || + process.env.ROBLOX_WEBHOOK_SECRET || + ""; const sig = (req.headers["x-shared-secret"] as string) || (req.headers["x-roblox-signature"] as string) || @@ -25,7 +27,9 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { const payload: Record = { ...(typeof req.body === "object" && req.body ? req.body : {}), - ip: ((req.headers["x-forwarded-for"] as string) || "").split(",")[0] || null, + ip: + ((req.headers["x-forwarded-for"] as string) || "").split(",")[0] || + null, ua: (req.headers["user-agent"] as string) || null, received_at: new Date().toISOString(), };