From 4ace7a3ea010d3bf453f2177568ccc7de4261662 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sun, 27 Nov 2022 23:19:54 +0200 Subject: [PATCH] cleanup --- src/server/endpoints/pages/Home.js | 3 ++- src/server/structures/User.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/server/endpoints/pages/Home.js b/src/server/endpoints/pages/Home.js index f0c8355..c6549b1 100644 --- a/src/server/endpoints/pages/Home.js +++ b/src/server/endpoints/pages/Home.js @@ -8,7 +8,8 @@ class Home extends Endpoint { super(server, { name: 'home', - path: '/*' + path: '/*', + loadOrder: 10 }); this.methods = [ diff --git a/src/server/structures/User.js b/src/server/structures/User.js index 9dfa09f..736f9ad 100644 --- a/src/server/structures/User.js +++ b/src/server/structures/User.js @@ -4,7 +4,8 @@ const { Util } = require('../../util'); const UserApplicataion = require('./UserApplication'); // Fields omitted in safeJson -const ProtectedFields = [ '_id', '_otpSecret', '_passwordHash' ]; +// Should be keys used in the json, not the ones defined in the constructor +const ProtectedFields = [ '_id', 'otpSecret', 'password' ]; class User { @@ -75,7 +76,7 @@ class User { this.cachedTimestamp = Date.now(); this.createdTimestamp = data.createdTimestamp || Date.now(); - this.avatarURL = data.avatarURL || null; + this.avatar = data.avatar || null; } @@ -180,7 +181,7 @@ class User { applications: this._applications, createdTimestamp: this.createdTimestamp, disabled: this.disabled, - avatarURL: this.avatarURL, + avatar: this.avatar, }; }