feat: log entitlement purchases #3

Merged
naomi merged 9 commits from feat/entitlements into main 2025-07-06 13:48:18 -07:00
7 changed files with 339 additions and 5 deletions
Showing only changes of commit 28dda101d7 - Show all commits

View File

@ -130,22 +130,8 @@ export const instantiateServer = (): void => {
}; }>(
"/entitlement",
async(request, response) => {
const signature = req.headers["x-signature-ed25519"];
const timestamp = req.headers["x-signature-timestamp"];
const rawBody = JSON.stringify(req.body);
const isValid = await verify(
rawBody,
signature,
timestamp,
this.client.publicKey,
crypto.webcrypto.subtle,
);
const isValid = await validateWebhook(request);
if (!isValid) {
return res.code(401).send("Invalid signature");
}
if (!validateWebhook(request)) {
await response.status(401).send({ success: false });
void sendDiscord(
"[NOTIFICATION]: Entitlement Event",