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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 = {}) {
|
||||
|
||||
Reference in New Issue
Block a user