mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2026-05-26 12:38:03 +00:00
BETTERZON-77: Changing error behavior as the previous behavior cloud have opened up security vulnerabilities (#38)
This commit is contained in:
@@ -49,7 +49,8 @@ usersRouter.post('/register', async (req: Request, res: Response) => {
|
||||
// Send the session details back to the user
|
||||
res.status(201).send(session);
|
||||
} catch (e) {
|
||||
res.status(404).send(e.message);
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({"message": "Internal Server Error. Try again later."}));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -78,7 +79,8 @@ usersRouter.post('/login', async (req: Request, res: Response) => {
|
||||
// Send the session details back to the user
|
||||
res.status(201).send(session);
|
||||
} catch (e) {
|
||||
res.status(404).send(e.message);
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({"message": "Internal Server Error. Try again later."}));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -107,6 +109,7 @@ usersRouter.post('/checkSessionValid', async (req: Request, res: Response) => {
|
||||
// Send the session details back to the user
|
||||
res.status(201).send(user);
|
||||
} catch (e) {
|
||||
res.status(404).send(e.message);
|
||||
console.log('Error handling a request: ' + e.message);
|
||||
res.status(500).send(JSON.stringify({"message": "Internal Server Error. Try again later."}));
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user