diff --git a/options.json b/options.json index c4465d8..f85c569 100644 --- a/options.json +++ b/options.json @@ -1,7 +1,7 @@ { "serverFilePath": "./src/server/Server.js", "shardOptions": { - "respawn": false + "respawn": true }, "shardCount": 1, "serverOptions": { diff --git a/src/server/Server.js b/src/server/Server.js index d0defba..db0bf6f 100644 --- a/src/server/Server.js +++ b/src/server/Server.js @@ -201,7 +201,7 @@ class Server extends EventEmitter { #logRequest (req, res, next) { res.once('finish', () => { - this.logger[[ 401, 403 ].includes(res.statusCode) ? 'unauthorised' : 'access'](`[${req.get('X-Forwarded-For') || req.socket.remoteAddress}] [STATUS: ${res.statusCode}] Request to [${req.method}] ${req.route?.path || req.path}`); + this.logger[[ 401, 403 ].includes(res.statusCode) ? 'unauthorised' : 'access'](`[${req.get('X-Forwarded-For') || req.socket.remoteAddress}] [STATUS: ${res.statusCode}] ${req.user ? `${req.user.name} (${req.user.id})` : '-'} Request to [${req.method}] ${req.route?.path || req.path}`); }); next(); } diff --git a/src/server/structures/User.js b/src/server/structures/User.js index 57224d4..efe51cf 100644 --- a/src/server/structures/User.js +++ b/src/server/structures/User.js @@ -59,12 +59,9 @@ class User extends AbstractUser { return Object.freeze({ ...this.#_externalProfiles }); } - // async fetchApplications () { - // const apps = await Promise.all(this._applications.map(id => this._db.fetchApplication(id))); - // for (const app of apps) - // this.applications[app.id] = app; - // return this.applications; - // } + async fetchApplications () { + return Promise.all(this.#_applications.map(id => this._db.fetchApplication(id))); + } async createApplication (name, { description } = {}, saveFn) { if (typeof saveFn !== 'function')