aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-05-12 13:29:00 -0700
committerAdam Soltys <[email protected]>2025-05-12 13:29:03 -0700
commit1f9d2f559e6fc5dc45cd0c3d111ae66ea28112ed (patch)
tree5ce3e61c5f0f67235ddafedd5643dce999a163c9 /routes
parente85ac7fa9d737fecd19cf91fbab1460dfbbf8182 (diff)
downloadcoinos-server-1f9d2f559e6fc5dc45cd0c3d111ae66ea28112ed.tar.gz
coinos-server-1f9d2f559e6fc5dc45cd0c3d111ae66ea28112ed.zip
whitelisting
Diffstat (limited to 'routes')
-rw-r--r--routes/users.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/routes/users.ts b/routes/users.ts
index 6b73513b..189d6f05 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -33,6 +33,15 @@ export default {
try {
user.balance = await g(`balance:${user.id}`);
user.locked = await ga(`balance:${user.id}`);
+
+ if (user.locked) {
+ const whitelisted = await db.sIsMember(
+ "whitelist",
+ user?.username?.toLowerCase().trim(),
+ );
+ if (whitelisted) user.locked = 0;
+ }
+
user.prompt = !!user.prompt;
if (user.pubkey) user.npub = nip19.npubEncode(user.pubkey);