chore: Remove method override middleware (#4315)
* chore: Remove method override middleware * wip * CodeQL * max/min
This commit is contained in:
@@ -12,10 +12,16 @@ import InviteReminderTask from "@server/queues/tasks/InviteReminderTask";
|
||||
const router = new Router();
|
||||
|
||||
const cronHandler = async (ctx: Context) => {
|
||||
const { token, limit = 500 } = ctx.body as { token?: string; limit: number };
|
||||
const { token, limit = 500 } = (ctx.request.body ?? ctx.request.query) as {
|
||||
token?: string;
|
||||
limit: number;
|
||||
};
|
||||
|
||||
if (!token || typeof token !== "string") {
|
||||
throw AuthenticationError("Token is required");
|
||||
}
|
||||
|
||||
if (
|
||||
!token ||
|
||||
token.length !== env.UTILS_SECRET.length ||
|
||||
!crypto.timingSafeEqual(
|
||||
Buffer.from(env.UTILS_SECRET),
|
||||
|
||||
Reference in New Issue
Block a user