diff options
| author | Adam Soltys <[email protected]> | 2025-09-20 18:18:31 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-09-20 18:18:41 -0700 |
| commit | af0f19c261e06f165cb6a24f1a6247e971649d88 (patch) | |
| tree | a860d297d86618658db5bdfd7059afd34831bc8f | |
| parent | 77f6dcea1148f33737f5c772e42bc1c5a12b5be1 (diff) | |
| download | coinos-server-af0f19c261e06f165cb6a24f1a6247e971649d88.tar.gz coinos-server-af0f19c261e06f165cb6a24f1a6247e971649d88.zip | |
fix invoice user
| -rwxr-xr-x | bun.lockb | bin | 230714 -> 230690 bytes | |||
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | routes/invoices.ts | 4 |
3 files changed, 3 insertions, 3 deletions
| Binary files differ diff --git a/package.json b/package.json index 24fdc2af..71ce64f7 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "dependencies": { "@asoltys/clightning-client": "^0.1.10", "@aws-sdk/client-ses": "^3.886.0", - "@cashu/cashu-ts": "^2.7.1", + "@cashu/cashu-ts": "^2.7.2", "@coinos/rpc": "^0.0.6", "@fastify/cors": "^8.5.0", "@fastify/http-proxy": "^9.5.0", diff --git a/routes/invoices.ts b/routes/invoices.ts index 3cc6bab0..fb7e319d 100644 --- a/routes/invoices.ts +++ b/routes/invoices.ts @@ -58,12 +58,12 @@ export default { if (tip < 0) fail("Invalid tip"); let invoice = await g(`invoice:${id}`); - const user = req.user || (await g(`user:${invoice.uid}`)); + const user = await g(`user:${invoice.uid}`); if (typeof tip !== "undefined") invoice.tip = tip; if (webhook && secret) { - if (invoice.uid !== user?.id) fail("Unauthorized"); + if (invoice.uid !== req.user?.id) fail("Unauthorized"); invoice.webhook = webhook; invoice.secret = secret; } |
