diff --git a/src/constants.js b/src/constants.js index 0ebb850aa..d6db8c4da 100644 --- a/src/constants.js +++ b/src/constants.js @@ -14,7 +14,7 @@ exports = module.exports = { ADMIN_CLIENT_ID: 'webadmin', // oauth client id ADMIN_APPID: 'admin', // admin appid (settingsdb) - GHOST_USER_FILE: '/tmp/cloudron_ghost', + GHOST_USER_FILE: '/tmp/cloudron_ghost.json', DEFAULT_MEMORY_LIMIT: (256 * 1024 * 1024) // see also client.js }; diff --git a/src/user.js b/src/user.js index 087b54096..d8777985b 100644 --- a/src/user.js +++ b/src/user.js @@ -196,8 +196,7 @@ function verifyGhost(username, password) { assert.strictEqual(typeof username, 'string'); assert.strictEqual(typeof password, 'string'); - var ghostFile = safe.fs.readFileSync(constants.GHOST_USER_FILE, 'utf8'); - var ghostData = safe.JSON.parse(ghostFile); + var ghostData = safe.require(constants.GHOST_USER_FILE); if (!ghostData) return false; if (username in ghostData && ghostData[username] === password) {