Refactor logger usage and add userRepository module

Replaces custom logger instantiation with a shared logger import across modules and routes. Moves player property and privilege management from authRepository to a new userRepository, expanding userRepository with additional user management functions (ban, unban, preferences, privileges, bans). Updates service and route files to use userRepository where appropriate. Adds new session join route and schema, and utility for UUID formatting.
This commit is contained in:
2025-12-24 04:22:43 +01:00
parent 80bca31d9a
commit 2519d8078a
18 changed files with 438 additions and 76 deletions

View File

@@ -1,7 +1,8 @@
class SessionError extends Error {
constructor(statusCode, errorMessage, path) {
constructor(statusCode, error, errorMessage, path) {
super(errorMessage)
this.path = path
this.error = error
this.statusCode = statusCode
this.errorMessage = errorMessage
this.isOperational = true
@@ -13,6 +14,9 @@ class SessionError extends Error {
path: this.path,
errorMessage: this.errorMessage
}
if (this.error != undefined) {
response.error = this.error
}
return response
}
}

View File

@@ -1,7 +1,6 @@
const path = require("node:path")
const DefaultError = require("./DefaultError")
const Logger = require("../modules/logger")
const logger = Logger.createLogger(path.join(__dirname, ".."))
const logger = require("../modules/logger")
class ValidationError extends DefaultError {
constructor(zodResult, config = {}, context = {}) {