aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-01-21 13:33:37 -0800
committerAdam Soltys <[email protected]>2026-01-21 13:33:37 -0800
commite5e5f2acf46ce6a86b668407a67fce3f8edac4bc (patch)
tree9b52fb43658d0302539a1be68c33ca13d0dcf24a /routes
parenta665d7f229e17d691e371d8683e578d59c19b297 (diff)
downloadcoinos-server-e5e5f2acf46ce6a86b668407a67fce3f8edac4bc.tar.gz
coinos-server-e5e5f2acf46ce6a86b668407a67fce3f8edac4bc.zip
require auth for accounts
Diffstat (limited to 'routes')
-rw-r--r--routes/users.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/routes/users.ts b/routes/users.ts
index fee39344..ed638d9e 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -789,6 +789,11 @@ export default {
async account(req, res) {
const { id } = req.params;
+ const { id: uid } = req.user;
+
+ const pos = await db.lPos(`${uid}:accounts`, id);
+ if (pos == null) fail("account not found");
+
const account = await g(`account:${id}`);
if (account) account.balance = await g(`balance:${id}`);
res.send(account);