Correct response code + user id property
This commit is contained in:
@@ -40,7 +40,7 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
textEncode(`${timestamp.replace("t=", "")}.${body}`),
|
textEncode(`${timestamp.replace("t=", "")}.${body}`),
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
return jsonError("Invalid signature", 403);
|
return jsonError("Invalid signature", 401);
|
||||||
|
|
||||||
const data = JSON.parse(body);
|
const data = JSON.parse(body);
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
return jsonError("Invalid event type", 400);
|
return jsonError("Invalid event type", 400);
|
||||||
|
|
||||||
const { prisma } = context.data;
|
const { prisma } = context.data;
|
||||||
const userId = data.EventPrisma.UserId;
|
const userId = data.EventPayload.UserId;
|
||||||
|
|
||||||
if (typeof userId !== "number") return jsonError("Invalid user id", 400);
|
if (typeof userId !== "number") return jsonError("Invalid user id", 400);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user