diff options
| author | Adam Soltys <[email protected]> | 2025-05-13 13:25:09 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-05-13 13:25:09 -0700 |
| commit | bc54c2d5cfa150c2098011f9900503a0333657d0 (patch) | |
| tree | b1c04c1dd45be303257b18b7c0b54b935f3d9d8e | |
| parent | 1f9d2f559e6fc5dc45cd0c3d111ae66ea28112ed (diff) | |
| download | coinos-server-bc54c2d5cfa150c2098011f9900503a0333657d0.tar.gz coinos-server-bc54c2d5cfa150c2098011f9900503a0333657d0.zip | |
check blacklist
| -rw-r--r-- | lib/payments.ts | 2 | ||||
| -rw-r--r-- | routes/users.ts | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/payments.ts b/lib/payments.ts index bc19dae9..e3a2e0de 100644 --- a/lib/payments.ts +++ b/lib/payments.ts @@ -120,7 +120,7 @@ export const debit = async ({ : 0; if (aid && aid !== uid) ourfee = 0; - const frozenBalance = whitelisted ? 0 : await ga(`balance:${uid}`); + const frozenBalance = (!blacklisted || whitelisted) ? 0 : await ga(`balance:${uid}`); ourfee = await db.debit( `balance:${aid || uid}`, diff --git a/routes/users.ts b/routes/users.ts index 189d6f05..e39b3337 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -35,11 +35,17 @@ export default { user.locked = await ga(`balance:${user.id}`); if (user.locked) { + const blacklisted = await db.sIsMember( + "blacklist", + user?.username?.toLowerCase().trim(), + ); + const whitelisted = await db.sIsMember( "whitelist", user?.username?.toLowerCase().trim(), ); - if (whitelisted) user.locked = 0; + + if (!blacklisted || whitelisted) user.locked = 0; } user.prompt = !!user.prompt; |
