diff --git a/routes/manage.js b/routes/manage.js index a5cdc1b..b1d8809 100644 --- a/routes/manage.js +++ b/routes/manage.js @@ -189,6 +189,7 @@ router.get('/account', checkLoginStatus.user, (req, res, next) => { }); router.post('/account', checkLoginStatus.user, async function(req, res, next) { + const name = req.body.name; const email = req.body.email; const password = req.body.password; @@ -206,8 +207,8 @@ router.post('/account', checkLoginStatus.user, async function(req, res, next) { const isAdmin = loggedInAccountIsAdmin ? !!req.body.admin : false; if(remove) await accounts.remove(accountID); - else if(accountID) await accounts.edit(accountID, email, password, isAdmin); - else await accounts.create(req.body.email, req.body.password, !!req.body.admin); + else if(accountID) await accounts.edit(accountID, email, password, isAdmin, name); + else await accounts.create(email, password, !!req.body.admin, name); res.redirect('/manage#accounts'); }