generated from nhcarrigan/template
fix: forgot to save
This commit is contained in:
@ -130,22 +130,8 @@ export const instantiateServer = (): void => {
|
|||||||
}; }>(
|
}; }>(
|
||||||
"/entitlement",
|
"/entitlement",
|
||||||
async(request, response) => {
|
async(request, response) => {
|
||||||
const signature = req.headers["x-signature-ed25519"];
|
const isValid = await validateWebhook(request);
|
||||||
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,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
return res.code(401).send("Invalid signature");
|
|
||||||
}
|
|
||||||
if (!validateWebhook(request)) {
|
|
||||||
await response.status(401).send({ success: false });
|
await response.status(401).send({ success: false });
|
||||||
void sendDiscord(
|
void sendDiscord(
|
||||||
"[NOTIFICATION]: Entitlement Event",
|
"[NOTIFICATION]: Entitlement Event",
|
||||||
|
Reference in New Issue
Block a user