aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-03 14:34:23 -0800
committerAdam Soltys <[email protected]>2024-12-03 14:34:23 -0800
commit0a318bf04d7691b47f65e1aa431a618d9bd935c0 (patch)
tree01d4aeeaa1c238c19c214f9daae12d892ad18d01 /routes
parentf011ed304da9d72549ec0d967a7500cfe487765f (diff)
downloadcoinos-server-0a318bf04d7691b47f65e1aa431a618d9bd935c0.tar.gz
coinos-server-0a318bf04d7691b47f65e1aa431a618d9bd935c0.zip
return nwc and token on registration
Diffstat (limited to 'routes')
-rw-r--r--routes/users.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/routes/users.ts b/routes/users.ts
index a2b3b407..9588727f 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -156,10 +156,16 @@ export default {
"salt",
];
- user = await register(pick(user, fields), ip, false);
+ user = await register(pick(user, fields), ip);
+
+ const payload = { id: user.id };
+ const token = jwt.sign(payload, config.jwt);
+
l("registered new user", user.username);
- res.send(pick(user, whitelist));
+
+ res.send({ ...pick(user, whitelist), token });
} catch (e) {
+ console.log(e);
res.code(500).send(e.message);
}
},