Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Akkadius committed Jan 20, 2020
1 parent 2b8f1b7 commit de02a94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/core/auth-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = {
if (!this.appKey) {
this.appKey = uuidv4();
eqemuConfigService.setAdminPanelConfig('application.key', this.appKey);
eqemuConfigService.saveServerConfig(this.getServerConfig());
eqemuConfigService.saveServerConfig();
}

return this;
Expand Down Expand Up @@ -72,7 +72,7 @@ module.exports = {
'application.admin.password',
this.genRandomString(30)
);

eqemuConfigService.saveServerConfig();
}

Expand Down
8 changes: 6 additions & 2 deletions app/core/eqemu-config-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ module.exports = {
getFreshServerConfig() {
this.serverConfig = JSON.parse(fs.readFileSync(this.getServerConfigPath(), 'utf8'));

debug("[getFreshServerConfig] fetching");

return this.serverConfig;
},

Expand Down Expand Up @@ -127,7 +129,7 @@ module.exports = {
*/
saveServerConfig(data = undefined) {
if (!data) {
data = this.getFreshServerConfig()
data = this.getServerConfig()
}

debug('[saveServerConfig] writing config')
Expand Down Expand Up @@ -172,8 +174,10 @@ module.exports = {
debug("[getAdminPanelConfig] config [%s] = [%s] default [%s]", accessor, configVar, defaultValue);

if (typeof configVar === "undefined" && defaultValue !== "") {
debug("[getAdminPanelConfig] writing default value for [%s] default [%s]", accessor, defaultValue);

this.setAdminPanelConfig(accessor, defaultValue);
this.saveServerConfig();
this.saveServerConfig(this.serverConfig);
}

return (configVar ? configVar : defaultValue)
Expand Down

0 comments on commit de02a94

Please sign in to comment.