diff options
| author | Adam Soltys <[email protected]> | 2026-01-21 13:33:37 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-01-21 13:33:37 -0800 |
| commit | e5e5f2acf46ce6a86b668407a67fce3f8edac4bc (patch) | |
| tree | 9b52fb43658d0302539a1be68c33ca13d0dcf24a /routes/users.ts | |
| parent | a665d7f229e17d691e371d8683e578d59c19b297 (diff) | |
| download | coinos-server-e5e5f2acf46ce6a86b668407a67fce3f8edac4bc.tar.gz coinos-server-e5e5f2acf46ce6a86b668407a67fce3f8edac4bc.zip | |
require auth for accounts
Diffstat (limited to 'routes/users.ts')
| -rw-r--r-- | routes/users.ts | 5 |
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); |
