fix(auth): handle sign-in attempts from emails with no password (#933)

* fix(auth): dont reject promise when missing password

* fix(auth): use static fallback error message
This commit is contained in:
Jakob Ankarhem
2021-02-15 09:34:40 +01:00
committed by GitHub
parent 8a7fa00164
commit 5e37a96bc0
2 changed files with 6 additions and 3 deletions

View File

@@ -176,7 +176,10 @@ authRoutes.post('/local', async (req, res, next) => {
return res.status(200).json(user?.filter() ?? {});
} catch (e) {
logger.error(e.message, { label: 'Auth' });
logger.error('Something went wrong when trying to authenticate', {
label: 'Auth',
error: e.message,
});
return next({
status: 500,
message: 'Something went wrong.',