diff options
| -rw-r--r-- | lib/nwc.ts | 2 | ||||
| -rw-r--r-- | routes/users.ts | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -132,7 +132,7 @@ const handle = (method, params, ev, app, user) => ); const whitelisted = await db.sIsMember("activeNwc", pubkey); - if ((amount > 1000 && !(whitelisted || created)) || spent + amount > max_amount) { + if ((amount > 1000 && !(whitelisted || created)) || (max_amount > 0 && (spent + amount > max_amount))) { warn("budget exceeded", pubkey, user?.username, spent, amount, max_amount); return error({ code: "QUOTA_EXCEEDED", diff --git a/routes/users.ts b/routes/users.ts index 577d1f5a..f7112591 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -866,7 +866,7 @@ export default { if (app && uid !== app.uid) fail("Unauthorized"); if (secret) pubkey = getPublicKey(secret); - if (!app) app = { created: Date.now }; + if (!app) app = { created: Date.now() }; app = { ...app, |
