From dcd89f2295b125630235dc05cfcb7c151b908d99 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 13 Apr 2024 00:13:36 +0300 Subject: [PATCH] Fix public facing messages --- src/endpoints/users-public.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/endpoints/users-public.js b/src/endpoints/users-public.js index f808d525f..1dea9173a 100644 --- a/src/endpoints/users-public.js +++ b/src/endpoints/users-public.js @@ -59,7 +59,7 @@ router.post('/login', jsonParser, async (request, response) => { if (!user) { console.log('Login failed: User not found'); - return response.status(403).json({ error: 'User not found' }); + return response.status(403).json({ error: 'Incorrect credentials' }); } if (!user.enabled) { @@ -67,10 +67,9 @@ router.post('/login', jsonParser, async (request, response) => { return response.status(403).json({ error: 'User is disabled' }); } - if (user.password && user.password !== getPasswordHash(request.body.password, user.salt)) { console.log('Login failed: Incorrect password'); - return response.status(403).json({ error: 'Incorrect password' }); + return response.status(403).json({ error: 'Incorrect credentials' }); } if (!request.session) {