update icons module

This commit is contained in:
2025-12-16 11:16:49 +03:30
parent cfa7f1e3fe
commit eb47fd75ea
2 changed files with 4 additions and 5 deletions
@@ -22,10 +22,9 @@ export class SuperAdminAuthGuard implements CanActivate {
const { username, password } = credentials; const { username, password } = credentials;
const expectedUsername = this.configService.get<string>('SUPER_ADMIN_USERNAME') ?? 'danak@dsc.com'; const expectedUsername = this.configService.get<string>('SUPER_ADMIN_USERNAME') ?? 'danak@dsc.com';
const expectedPassword = this.configService.get<string>('SUPER_ADMIN_PASSWORD') ?? 'DsCdAnAk?@#AFG'; const expectedPassword = this.configService.get<string>('SUPER_ADMIN_PASSWORD') ?? 'DsCdAnAk?@ABC';
if (username !== expectedUsername || password !== expectedPassword) { if (username !== expectedUsername || password !== expectedPassword) {
this.logger.warn('Invalid super admin credentials attempt', { username }); this.logger.warn(`Invalid super admin credentials attempt for username: ${username}`);
throw new UnauthorizedException('Invalid credentials'); throw new UnauthorizedException('Invalid credentials');
} }
@@ -15,12 +15,12 @@ import {
ApiBody, ApiBody,
ApiBearerAuth, ApiBearerAuth,
} from '@nestjs/swagger'; } from '@nestjs/swagger';
import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard'; import { SuperAdminAuthGuard } from 'src/modules/auth/guards/superAdminAuth.guard';
import { UseGuards } from '@nestjs/common'; import { UseGuards } from '@nestjs/common';
@ApiTags('icons') @ApiTags('icons')
@Controller('admin/icons') @Controller('admin/icons')
@UseGuards(AdminAuthGuard) @UseGuards(SuperAdminAuthGuard)
@ApiBearerAuth() @ApiBearerAuth()
export class IconsController { export class IconsController {
constructor( constructor(