summaryrefslogtreecommitdiffstats
path: root/server/api/users.js
diff options
context:
space:
mode:
authorJannik Schönartz2019-02-23 06:37:14 +0100
committerJannik Schönartz2019-02-23 06:37:14 +0100
commitd2e1a80e2c7a4d807cb30899c0f2f20127396687 (patch)
tree1d648a3302acc9815404b2ed375b90f0dc518841 /server/api/users.js
parent[webapp/router] Fix forwarding bug while loggedout calling / (diff)
downloadbas-d2e1a80e2c7a4d807cb30899c0f2f20127396687.tar.gz
bas-d2e1a80e2c7a4d807cb30899c0f2f20127396687.tar.xz
bas-d2e1a80e2c7a4d807cb30899c0f2f20127396687.zip
[Account] Add password change functionality
[server] Remove hased password from userinfo api Implement change password function [webapp] Fix z-index for the fixed tab bar (udo) Implement userinfo and change password in the account module
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)
})
// ############################################################################