diff --git a/features/status-dashboard/server/src/api/hosts.controller.integration.spec.ts b/features/status-dashboard/server/src/api/hosts.controller.integration.spec.ts index d5e18545b..635ad24cc 100644 --- a/features/status-dashboard/server/src/api/hosts.controller.integration.spec.ts +++ b/features/status-dashboard/server/src/api/hosts.controller.integration.spec.ts @@ -107,7 +107,7 @@ describe('HostsController (Integration)', () => { await app.init(); // Generate valid JWT token for authenticated tests - validJwtToken = await authService.login('test-password'); + validJwtToken = authService.login('test-password'); }); afterEach(async () => { @@ -156,7 +156,7 @@ describe('HostsController (Integration)', () => { it('should reject request with expired JWT token', async () => { // Create token with immediate expiration - const _expiredToken = await authService.login('test-password'); + const _expiredToken = authService.login('test-password'); // Override token expiration by creating a new token manually // (in real scenario, wait for expiration or mock time) diff --git a/features/status-dashboard/server/src/api/metrics.controller.integration.spec.ts b/features/status-dashboard/server/src/api/metrics.controller.integration.spec.ts index 2540e0231..63528864e 100644 --- a/features/status-dashboard/server/src/api/metrics.controller.integration.spec.ts +++ b/features/status-dashboard/server/src/api/metrics.controller.integration.spec.ts @@ -177,7 +177,7 @@ describe('MetricsController (Integration)', () => { }); it('should reject JWT authentication (only mTLS/API Key allowed)', async () => { - const jwtToken = await authService.login('test-password'); + const jwtToken = authService.login('test-password'); await request(app.getHttpServer()) .post('/api/metrics/report') @@ -466,7 +466,7 @@ describe('MetricsController (Integration)', () => { }); it('should NOT accept JWT authentication (only mTLS/API Key)', async () => { - const jwtToken = await authService.login('test-password'); + const jwtToken = authService.login('test-password'); await request(app.getHttpServer()) .post('/api/metrics/report') diff --git a/features/status-dashboard/server/src/api/status.controller.integration.spec.ts b/features/status-dashboard/server/src/api/status.controller.integration.spec.ts index f7d699f9d..ae6f49bcf 100644 --- a/features/status-dashboard/server/src/api/status.controller.integration.spec.ts +++ b/features/status-dashboard/server/src/api/status.controller.integration.spec.ts @@ -116,7 +116,7 @@ describe('StatusController (Integration)', () => { await app.init(); - validJwtToken = await authService.login('test-password'); + validJwtToken = authService.login('test-password'); }); afterEach(async () => { diff --git a/features/status-dashboard/server/src/auth/auth.controller.ts b/features/status-dashboard/server/src/auth/auth.controller.ts index 8669d2713..4d6b227ff 100644 --- a/features/status-dashboard/server/src/auth/auth.controller.ts +++ b/features/status-dashboard/server/src/auth/auth.controller.ts @@ -39,11 +39,11 @@ export class AuthController { @HttpCode(HttpStatus.OK) @UseGuards(RateLimitGuard) @RateLimit({ ttl: 60, limit: 5 }) // 5 attempts per minute - async login(@Body() dto: LoginDto): Promise { + login(@Body() dto: LoginDto): LoginResponse { let token: string | null; try { - token = await this.authService.login(dto.password, dto.totp); + token = this.authService.login(dto.password, dto.totp); } catch (error) { // If TOTP is required but not provided, throw specific error if (error instanceof UnauthorizedException) { diff --git a/features/status-dashboard/server/src/auth/auth.service.ts b/features/status-dashboard/server/src/auth/auth.service.ts index 05a76a655..d30c08c74 100644 --- a/features/status-dashboard/server/src/auth/auth.service.ts +++ b/features/status-dashboard/server/src/auth/auth.service.ts @@ -23,7 +23,7 @@ export class AuthService { * @returns JWT token or null if authentication fails * @throws UnauthorizedException if TOTP is required but not provided */ - async login(password: string, totp?: string): Promise { + login(password: string, totp?: string): string | null { const { adminPassword, totpSecret } = this.configService.auth; // Check password diff --git a/features/status-dashboard/server/src/cron/alert.service.ts b/features/status-dashboard/server/src/cron/alert.service.ts index d75eed5a9..70839a70b 100644 --- a/features/status-dashboard/server/src/cron/alert.service.ts +++ b/features/status-dashboard/server/src/cron/alert.service.ts @@ -15,7 +15,7 @@ export class AlertService { /** * Send alert notification */ - async sendAlert(message: string, severity: AlertSeverity = 'info'): Promise { + sendAlert(message: string, severity: AlertSeverity = 'info'): void { const timestamp = new Date().toISOString(); const severityUpper = severity.toUpperCase(); const formattedMessage = `[${timestamp}] [${severityUpper}] ${message}`; diff --git a/features/status-dashboard/server/src/logging/audit-logging.interceptor.spec.ts b/features/status-dashboard/server/src/logging/audit-logging.interceptor.spec.ts index fd99b3e08..286803f69 100644 --- a/features/status-dashboard/server/src/logging/audit-logging.interceptor.spec.ts +++ b/features/status-dashboard/server/src/logging/audit-logging.interceptor.spec.ts @@ -8,7 +8,7 @@ describe('AuditLoggingInterceptor', () => { let interceptor: AuditLoggingInterceptor; let mockLogger: any; - beforeEach(async () => { + beforeEach(() => { interceptor = new AuditLoggingInterceptor(); mockLogger = { log: vi.fn(), diff --git a/features/status-dashboard/server/src/storage/metrics-persistence.service.ts b/features/status-dashboard/server/src/storage/metrics-persistence.service.ts index 3af77b1e5..c3bdd112c 100644 --- a/features/status-dashboard/server/src/storage/metrics-persistence.service.ts +++ b/features/status-dashboard/server/src/storage/metrics-persistence.service.ts @@ -33,7 +33,7 @@ export class MetricsPersistenceService { * * @param metrics - Host metrics to persist */ - async persistMetrics(metrics: HostMetrics): Promise { + persistMetrics(metrics: HostMetrics): void { // Convert HostMetrics to VPSResources format const vpsResources = this.convertToVPSResources(metrics);