feat: add throttler

This commit is contained in:
2026-11-06 18:32:48 +03:30
parent 71ce020803
commit 2051090d3d
10 changed files with 16 additions and 18 deletions
@@ -5,7 +5,7 @@ import { Public } from '@/modules/auth/decorators/public.decorator';
import { Throttle } from '@nestjs/throttler';
@Controller('admin/auth')
@Throttle({ login: {} })
@Throttle({ default: { limit: 30, ttl: 60_000 } })
export class AdminAuthController {
constructor(
/**
@@ -21,7 +21,7 @@ import { Throttle } from '@nestjs/throttler';
@Controller('admin/choices')
@Roles(Role.SUPERUSER, Role.ADMIN)
@Throttle({ admin: {} })
@Throttle({ default: { limit: 120, ttl: 60_000 } })
export class AdminChoicesController {
constructor(
/**
@@ -19,7 +19,7 @@ import { Throttle } from '@nestjs/throttler';
@Controller('admin/question-transitions')
@Roles(Role.SUPERUSER, Role.ADMIN)
@Throttle({ admin: {} })
@Throttle({ default: { limit: 120, ttl: 60_000 } })
export class AdminQuestionTransitionsController {
constructor(
/**
@@ -25,7 +25,7 @@ import { Throttle } from '@nestjs/throttler';
@Controller('admin/questions')
@Roles(Role.SUPERUSER, Role.ADMIN)
@Throttle({ admin: {} })
@Throttle({ default: { limit: 120, ttl: 60_000 } })
export class AdminQuestionsController {
constructor(
/**
@@ -19,7 +19,7 @@ import { Throttle } from '@nestjs/throttler';
@Controller('admin/scoring')
@Roles(Role.SUPERUSER, Role.ADMIN)
@Throttle({ admin: {} })
@Throttle({ default: { limit: 120, ttl: 60_000 } })
export class AdminScoringController {
constructor(
/**
@@ -21,7 +21,7 @@ import { Throttle } from '@nestjs/throttler';
@Controller('admin/tests')
@Roles(Role.SUPERUSER, Role.ADMIN)
@Throttle({ admin: {} })
@Throttle({ default: { limit: 120, ttl: 60_000 } })
export class AdminTestsController {
constructor(
/**