fix(security): resolve all critical, high, and medium security vulnerabilities
Deploy Canina / deploy (push) Waiting to run
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 11s

This commit is contained in:
parsa committed 2026-09-23 22:05:12 +03:30
1 parent da26dd1c8d
commit dc88677169
33 files changed
+438 -85

No files matched your search

+10 -2
View File
@@ -92,6 +92,7 @@ export class AuthController {
return this.authService.login(loginDto);
}
@Throttle({ default: { limit: 5, ttl: 300000 } }) // 5 attempts per 5 minutes
@Post('admin-login')
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'ورود ادمین به پنل مدیریت' })
@@ -116,11 +117,18 @@ export class AuthController {
return this.authService.refresh(req.user);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Post('logout')
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'خروج از حساب کاربری' })
@ApiOperation({ summary: 'خروج از حساب کاربری و ابطال توکن' })
@ApiOkResponse({ description: 'با موفقیت خارج شدید' })
logout() {
async logout(@Req() req: any) {
const authHeader = req.headers?.authorization;
if (authHeader && authHeader.startsWith('Bearer ')) {
const token = authHeader.replace('Bearer ', '').trim();
await this.authService.blacklistToken(token);
}
return { success: true, message: 'با موفقیت خارج شدید' };
}
}