From 652d5fb09f5cb597f971151a381e7defb5454f68 Mon Sep 17 00:00:00 2001 From: underpostnet Date: Tue, 31 Dec 2024 12:22:04 +0000 Subject: [PATCH] Update github repo package --- src/client/components/core/Auth.js | 7 ++++--- src/server/valkey.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/components/core/Auth.js b/src/client/components/core/Auth.js index c615c49..9a7e12a 100644 --- a/src/client/components/core/Auth.js +++ b/src/client/components/core/Auth.js @@ -70,13 +70,13 @@ const Auth = { }, }; })(); - const { status, data } = result; + const { status, data, message } = result; if (status === 'success') { localStorage.setItem('jwt', token); await LogIn.Trigger({ user: data.user }); await Account.updateForm(data.user); return { user: data.user }; - } + } else throw new Error(message); } // anon guest session @@ -91,7 +91,8 @@ const Auth = { } this.setGuestToken(guestToken); - let { data } = await UserService.get({ id: 'auth' }); + let { data, status, message } = await UserService.get({ id: 'auth' }); + if (status === 'error') throw new Error(message); await Account.updateForm(data); return { user: data }; } catch (error) { diff --git a/src/server/valkey.js b/src/server/valkey.js index 6b7b236..cd9938e 100644 --- a/src/server/valkey.js +++ b/src/server/valkey.js @@ -46,7 +46,7 @@ const valkeyClientFactory = async () => { const getValkeyObject = async (key = '') => { if (!valkeyEnabled) { - logger.warn(disableValkeyErrorMessage + ' get: ', key); + logger.warn(disableValkeyErrorMessage + ' get', key); return null; } const object = await valkey.get(key);