Add auth check to game appeal metadata endpoint

This commit is contained in:
regalijan 2023-10-19 16:51:04 -04:00
parent f135368dc4
commit f51742e64d
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -2,6 +2,12 @@ import { jsonError, jsonResponse } from "../../common.js";
import precheck from "./precheck.js"; import precheck from "./precheck.js";
export async function onRequestPost(context: RequestContext) { export async function onRequestPost(context: RequestContext) {
if (
context.request.headers.get("authorization") !==
`Bearer ${context.env.ROBLOX_APPEALS_TOKEN}`
)
return jsonError("Unauthorized", 401);
const { id }: { id: any } = context.data.body; const { id }: { id: any } = context.data.body;
if (typeof id !== "number") return jsonError("Invalid user id", 400); if (typeof id !== "number") return jsonError("Invalid user id", 400);