diff options
| author | Adam Soltys <[email protected]> | 2024-01-24 04:16:36 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-01-24 04:16:36 +0000 |
| commit | 712560b83d8834145b974f2324b0deb5c18b91b8 (patch) | |
| tree | 05bffcc713434bd0e27c350f744f7ec6dde770b4 /lib | |
| parent | 9c7d46dbd78e4ba217adbc9d48fbd6e91f5fad99 (diff) | |
| download | coinos-server-712560b83d8834145b974f2324b0deb5c18b91b8.tar.gz coinos-server-712560b83d8834145b974f2324b0deb5c18b91b8.zip | |
check for undefined users
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/db.js | 5 | ||||
| -rw-r--r-- | lib/utils.js | 1 |
2 files changed, 2 insertions, 4 deletions
@@ -90,10 +90,7 @@ export let g = async (k) => { }; export let s = (k, v) => { - if (k === "user:null" || k === "user:undefined") { - warn("###### NULL USER #######"); - console.trace(); - } + if (k === "user:null" || k === "user:undefined") fail("null user"); db.set(k, JSON.stringify(v)); }; diff --git a/lib/utils.js b/lib/utils.js index e6aba14a..866bbaf9 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -66,5 +66,6 @@ export let fields = [ ]; export let getUser = async (username) => { + if (username === "undefined") fail("invalid user"); return migrate(username); }; |
