feat: add some security
This commit is contained in:
@@ -2,8 +2,10 @@ import { Body, Controller, HttpCode, HttpStatus, Post } from '@nestjs/common';
|
||||
import { AdminAuthService } from './providers/admin-auth.service';
|
||||
import { AdminLoginDTO } from './dtos/admin-login.dto';
|
||||
import { Public } from '@/modules/auth/decorators/public.decorator';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
|
||||
@Controller('admin/auth')
|
||||
@Throttle({ login: {} })
|
||||
export class AdminAuthController {
|
||||
constructor(
|
||||
/**
|
||||
|
||||
@@ -17,9 +17,11 @@ import {
|
||||
Post,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
|
||||
@Controller('admin/choices')
|
||||
@Roles(Role.SUPERUSER, Role.ADMIN)
|
||||
@Throttle({ admin: {} })
|
||||
export class AdminChoicesController {
|
||||
constructor(
|
||||
/**
|
||||
|
||||
@@ -21,9 +21,11 @@ import {
|
||||
Post,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
|
||||
@Controller('admin/questions')
|
||||
@Roles(Role.SUPERUSER, Role.ADMIN)
|
||||
@Throttle({ admin: {} })
|
||||
export class AdminQuestionsController {
|
||||
constructor(
|
||||
/**
|
||||
|
||||
@@ -15,9 +15,11 @@ import {
|
||||
Post,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
|
||||
@Controller('admin/scoring')
|
||||
@Roles(Role.SUPERUSER, Role.ADMIN)
|
||||
@Throttle({ admin: {} })
|
||||
export class AdminScoringController {
|
||||
constructor(
|
||||
/**
|
||||
|
||||
@@ -17,9 +17,11 @@ import {
|
||||
Post,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
|
||||
@Controller('admin/tests')
|
||||
@Roles(Role.SUPERUSER, Role.ADMIN)
|
||||
@Throttle({ admin: {} })
|
||||
export class AdminTestsController {
|
||||
constructor(
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user