Skip to content

Commit

Permalink
fix: do not leak db error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Oct 29, 2022
1 parent 88cb979 commit 52abe70
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/routes/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ router.post('/new-password', async (req, res, next) => {
await updatePassword(DB, password, resetToken);
res.status(200).send({ message: 'ok' });
} catch (error) {
next(error);
captureException(error);
next(new Error('Failed to create new password.'));
}
});

Expand Down Expand Up @@ -149,7 +150,10 @@ router.post('/login', async (req, res, next) => {
});
}
} catch (error) {
next(error);
captureException(error);
next(
new Error('Failed to login, please try again or register your account.')
);
}
});

Expand Down

0 comments on commit 52abe70

Please sign in to comment.