From 2b8f1b785833cacd13ae6027f3fc9dca54062b68 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 20 Jan 2020 04:43:56 -0600 Subject: [PATCH] Fix bug --- app/core/auth-service.js | 4 ++-- app/core/eqemu-config-service.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/core/auth-service.js b/app/core/auth-service.js index effe0cf..294aad2 100644 --- a/app/core/auth-service.js +++ b/app/core/auth-service.js @@ -44,7 +44,7 @@ module.exports = { if (!this.appKey) { this.appKey = uuidv4(); eqemuConfigService.setAdminPanelConfig('application.key', this.appKey); - eqemuConfigService.saveServerConfig(); + eqemuConfigService.saveServerConfig(this.getServerConfig()); } return this; @@ -72,7 +72,7 @@ module.exports = { 'application.admin.password', this.genRandomString(30) ); - + eqemuConfigService.saveServerConfig(); } diff --git a/app/core/eqemu-config-service.js b/app/core/eqemu-config-service.js index 1b51c33..d36a07b 100644 --- a/app/core/eqemu-config-service.js +++ b/app/core/eqemu-config-service.js @@ -126,6 +126,10 @@ module.exports = { * @returns {module.exports} */ saveServerConfig(data = undefined) { + if (!data) { + data = this.getFreshServerConfig() + } + debug('[saveServerConfig] writing config') fs.writeFileSync(