diff options
| author | Adam Soltys <[email protected]> | 2023-01-11 22:09:48 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-01-11 22:09:48 -0800 |
| commit | 3ec89497f4c90015de5e3118d38498ef6e37901c (patch) | |
| tree | ef09cdb5f3e3f99656f3ae6f047083bbb02ff67f /lib/utils.js | |
| parent | ded2c69ce89438326523a512b570be6eee4b23f0 (diff) | |
| download | coinos-server-3ec89497f4c90015de5e3118d38498ef6e37901c.tar.gz coinos-server-3ec89497f4c90015de5e3118d38498ef6e37901c.zip | |
migrating to redis
Diffstat (limited to 'lib/utils.js')
| -rw-r--r-- | lib/utils.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/utils.js b/lib/utils.js index 1513138b..559f8531 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,5 +1,5 @@ import store from "$lib/store"; -import redis from "$lib/redis"; +import { g } from "$lib/redis"; import config from "$config"; import ln from "$lib/ln"; @@ -19,7 +19,9 @@ export const requirePin = async ({ body, user }) => { }; export const getUser = async (uuid) => { - let user = await redis.get(`user:${uuid}`); + let user = g(`user:${uuid}`); + if (!user) throw new Error("user not found"); + user.haspin = !!user.pin; return user; |
