Skip to content

Commit e7a7ffe

Browse files
authored
Merge pull request #48 from DouglasNeuroInformatics/dev
fix: limit login requests per ip address to 5 per minute
2 parents bb0519a + 72c5137 commit e7a7ffe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/modules/auth/auth.controller.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Body, Controller, HttpCode, HttpStatus, Post } from '@nestjs/common';
22
import { ApiOperation } from '@nestjs/swagger';
3+
import { Throttle } from '@nestjs/throttler';
34

45
import { RouteAccess } from '../../decorators/route-access.decorator.js';
56
import { AuthService } from './auth.service.js';
@@ -15,6 +16,7 @@ export class AuthController {
1516
@HttpCode(HttpStatus.OK)
1617
@Post('login')
1718
@RouteAccess('public')
19+
@Throttle({ long: { limit: 5 } })
1820
async login(@Body() credentials: LoginCredentialsDto): Promise<LoginResponseBody> {
1921
return this.authService.login(credentials);
2022
}

0 commit comments

Comments
 (0)