backend: Improve error logging for missing security and webhook preferences

This commit is contained in:
Carlos Santos 2025-04-29 13:49:27 +02:00
parent b98d4d0cd9
commit f841f55c71
3 changed files with 5 additions and 1 deletions

View File

@ -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);

View File

@ -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' });
}

View File

@ -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' });
}