diff options
| author | Adam Soltys <[email protected]> | 2022-10-25 13:55:28 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-25 13:55:32 -0700 |
| commit | 2d7352ed9642ceea8beb32723191eb16d56830a6 (patch) | |
| tree | 0aef2e7bd3d82144708ee62f4d4a2f599f620db2 /lib/sockets.js | |
| parent | 6128d0ef6cd994807e6b30420be0874f1a8e94ef (diff) | |
| download | coinos-server-2d7352ed9642ceea8beb32723191eb16d56830a6.tar.gz coinos-server-2d7352ed9642ceea8beb32723191eb16d56830a6.zip | |
require pin on certain endpoints
Diffstat (limited to 'lib/sockets.js')
| -rw-r--r-- | lib/sockets.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sockets.js b/lib/sockets.js index 22072dd0..87cf7116 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -116,6 +116,8 @@ app.register(async function(app) { let user = await getUser(username); + let { haspin } = user; + if (user.locked) throw new Error("Account is locked"); let payments = await user.getPayments({ where: { @@ -142,9 +144,12 @@ app.register(async function(app) { user.accounts = accounts; user.keys = keys; user.payments = payments; + user.haspin = haspin; ws.user = user; - ws.send(JSON.stringify({ type: "login", data: user })); + ws.send( + JSON.stringify({ type: "login", data: pick(user, ...whitelist) }) + ); ws.send( JSON.stringify({ type: "version", data: config.clientVersion }) ); |
