Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add auth check to game appeal metadata endpoint
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent f135368 commit f51742e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions functions/api/game-appeals/metadata.ts
Expand Up @@ -2,6 +2,12 @@ import { jsonError, jsonResponse } from "../../common.js";
import precheck from "./precheck.js";

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;

if (typeof id !== "number") return jsonError("Invalid user id", 400);
Expand Down

0 comments on commit f51742e

Please sign in to comment.