aboutsummaryrefslogtreecommitdiffstats
path: root/routes/users.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/users.js')
-rw-r--r--routes/users.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/routes/users.js b/routes/users.js
index 6ffed55b..c7b6bfa4 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -251,7 +251,7 @@ app.post(
auth,
ah(async (req, res) => {
const { id } = req.body;
- const account = await db.Account.findOne({ where: { id }});
+ const account = await db.Account.findOne({ where: { id } });
if (account) await account.destroy();
res.end();
})
@@ -279,11 +279,11 @@ app.post(
emit(user.username, "account", account);
- if (pubkey) {
- user.index++;
- await user.save();
- emit(user.username, "user", user);
- }
+ if (pubkey) user.index++;
+ user.account_id = account.id;
+ await user.save();
+ user.account = account;
+ emit(user.username, "user", user);
res.send(account);
})