From f841f55c7105039edf28da12e6cfe4696eb274f8 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Tue, 29 Apr 2025 13:49:27 +0200 Subject: [PATCH] backend: Improve error logging for missing security and webhook preferences --- backend/src/controllers/auth.controller.ts | 2 +- .../global-preferences/security-preferences.controller.ts | 2 ++ .../global-preferences/webhook-preferences.controller.ts | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/controllers/auth.controller.ts b/backend/src/controllers/auth.controller.ts index 6ba3e8c..f9ea3f8 100644 --- a/backend/src/controllers/auth.controller.ts +++ b/backend/src/controllers/auth.controller.ts @@ -33,7 +33,7 @@ export const login = async (req: Request, res: Response) => { refreshToken, getCookieOptions(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/auth`, MEET_REFRESH_TOKEN_EXPIRATION) ); - logger.info(`Login succeeded for user ${username}`); + logger.info(`Login succeeded for user '${username}'`); return res.status(200).json({ message: 'Login succeeded' }); } catch (error) { logger.error('Error generating token' + error); diff --git a/backend/src/controllers/global-preferences/security-preferences.controller.ts b/backend/src/controllers/global-preferences/security-preferences.controller.ts index 8cf4d87..e03b83f 100644 --- a/backend/src/controllers/global-preferences/security-preferences.controller.ts +++ b/backend/src/controllers/global-preferences/security-preferences.controller.ts @@ -48,6 +48,8 @@ export const getSecurityPreferences = async (_req: Request, res: Response) => { const preferences = await preferenceService.getGlobalPreferences(); if (!preferences) { + //TODO: Create OpenViduMeetError for this case + logger.error('Security preferences not found'); return res.status(404).json({ message: 'Security preferences not found' }); } diff --git a/backend/src/controllers/global-preferences/webhook-preferences.controller.ts b/backend/src/controllers/global-preferences/webhook-preferences.controller.ts index 66d2d61..5f65051 100644 --- a/backend/src/controllers/global-preferences/webhook-preferences.controller.ts +++ b/backend/src/controllers/global-preferences/webhook-preferences.controller.ts @@ -36,6 +36,8 @@ export const getWebhookPreferences = async (_req: Request, res: Response) => { const preferences = await preferenceService.getGlobalPreferences(); if (!preferences) { + //TODO: Creare OpenViduMeetError for this case + logger.error('Webhooks preferences not found'); return res.status(404).json({ message: 'Webhooks preferences not found' }); }