summaryrefslogtreecommitdiffstats
path: root/server/api/users.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/api/users.js')
-rw-r--r--server/api/users.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/api/users.js b/server/api/users.js
index d7c290a..dc8df46 100644
--- a/server/api/users.js
+++ b/server/api/users.js
@@ -24,7 +24,10 @@ router.getAsync('/:id', async (req, res) => {
const id = req.params.id === 'current' ? req.user.id : req.params.id
const user = await db.user.findOne({ where: { id } })
if (user) {
- res.status(200).send(user)
+ // Remove the hased password.
+ let u = user.dataValues
+ delete u.password
+ res.status(200).send(u)
} else {
res.status(404).end()
}
@@ -55,7 +58,7 @@ router.post('/', (req, res) => {
// Post request for changing the password.
router.post('/:id/password', (req, res) => {
- authentication.changepassword(req, res)
+ authentication.changePassword(req, res)
})
// ############################################################################