feat: add throttler
This commit is contained in:
@@ -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(
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user