feat: add some security

This commit is contained in:
2026-07-11 17:34:18 +03:30
parent f80cf95f65
commit f399ec4a04
10 changed files with 69 additions and 9 deletions
+4
View File
@@ -4,6 +4,7 @@ import { AuthService } from './providers/auth.service';
import { VerifyOtpDTO } from './dtos/verify-otp.dto';
import { Public } from './decorators/public.decorator';
import { RefreshTokenDTO } from './dtos/refresh-token.dto';
import { Throttle } from '@nestjs/throttler';
@Controller('auth')
export class AuthController {
@@ -17,6 +18,7 @@ export class AuthController {
@Public()
@Post('login')
@HttpCode(HttpStatus.OK)
@Throttle({ login: {} })
public async logIn(@Body() loginDto: LoginDTO) {
return await this.authService.logIn(loginDto);
}
@@ -24,6 +26,7 @@ export class AuthController {
@Public()
@Post('verify-otp')
@HttpCode(HttpStatus.OK)
@Throttle({ otp: {} })
public async verifyOTP(@Body() verifyOtpDto: VerifyOtpDTO) {
return await this.authService.verifyOTP(verifyOtpDto);
}
@@ -31,6 +34,7 @@ export class AuthController {
@Public()
@Post('refresh')
@HttpCode(HttpStatus.OK)
@Throttle({ login: {} })
public async refreshToken(@Body() refreshTokenDto: RefreshTokenDTO) {
return await this.authService.refreshToken(refreshTokenDto);
}