fix: Move rate limiting middleware infront of auth

Tighten rate limits on attachment, comment, and group creation
This commit is contained in:
Tom Moor
2023-04-18 23:47:11 -04:00
parent fb8d8f8159
commit 54cf3fb8b1
7 changed files with 18 additions and 9 deletions

View File

@@ -17,8 +17,8 @@ const router = new Router();
router.post(
"team.update",
auth(),
rateLimiter(RateLimiterStrategy.TenPerHour),
auth(),
validate(T.TeamsUpdateSchema),
async (ctx: APIContext<T.TeamsUpdateSchemaReq>) => {
const { user } = ctx.state.auth;
@@ -43,8 +43,8 @@ router.post(
router.post(
"teams.create",
auth(),
rateLimiter(RateLimiterStrategy.FivePerHour),
auth(),
async (ctx: APIContext) => {
const { user } = ctx.state.auth;
const { name } = ctx.request.body;