Skip to content

Commit

Permalink
fix: NoLogin option #10
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSciFier committed Nov 11, 2022
1 parent 5e81fa1 commit f26e0b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion frontend/src/helpers/constants.js
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
14 changes: 8 additions & 6 deletions server/db/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,17 @@ function addUUID(username, uuid) {
* @returns {Promise<User>}
*/
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);
Expand Down

0 comments on commit f26e0b6

Please sign in to comment.