diff --git a/frontend/src/helpers/constants.js b/frontend/src/helpers/constants.js index 12bc69c..e35b44d 100644 --- a/frontend/src/helpers/constants.js +++ b/frontend/src/helpers/constants.js @@ -1,5 +1,5 @@ export const APP_NAME = "NeonLink"; -export const VERSION = "1.2.1"; +export const VERSION = "1.2.2"; export const DEF_MAX_ITEMS = 20; export const DEF_COLUMNS = 3; export const CARD_HEADER_STYLE = [ diff --git a/server/db/users.js b/server/db/users.js index 44dcda2..8eb6651 100644 --- a/server/db/users.js +++ b/server/db/users.js @@ -80,15 +80,17 @@ function addUUID(username, uuid) { * @returns {Promise} */ async function getUserByUUID(uuid) { - let user = db.prepare("SELECT * FROM users WHERE uuid=?").get(uuid); - if (user === undefined) return undefined; if (getNologin() === true) { - user = db.prepare("SELECT * FROM users WHERE usergroup=0 LIMIT 1").get(); - userSettings = db + let noLoginUser = db + .prepare("SELECT * FROM users WHERE usergroup=0 LIMIT 1") + .get(); + let noLoginUserSettings = db .prepare("SELECT * FROM userSettings WHERE uuid=?") - .get(user.uuid); - return { ...user, ...userSettings }; + .get(noLoginUser.uuid); + return { ...noLoginUser, ...noLoginUserSettings }; } + let user = db.prepare("SELECT * FROM users WHERE uuid=?").get(uuid); + if (user === undefined) return undefined; let userSettings = db.prepare("SELECT * FROM userSettings WHERE uuid=?").get(uuid) ?? initDefaultSettings(uuid);