diff options
| author | Adam Soltys <[email protected]> | 2023-01-11 22:09:48 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-01-12 15:44:13 -0800 |
| commit | c3565838644123e77881ff4f8536792f074047b9 (patch) | |
| tree | 96da43fd19940d2f0836e43a511f0a1fb365044d /lib/utils.js | |
| parent | ded2c69ce89438326523a512b570be6eee4b23f0 (diff) | |
| download | coinos-server-c3565838644123e77881ff4f8536792f074047b9.tar.gz coinos-server-c3565838644123e77881ff4f8536792f074047b9.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; |
