diff --git a/packages/nocodb/src/lib/sqlMgr/SqlMgr.ts b/packages/nocodb/src/lib/sqlMgr/SqlMgr.ts index 92c6393b2e..ca5c355268 100644 --- a/packages/nocodb/src/lib/sqlMgr/SqlMgr.ts +++ b/packages/nocodb/src/lib/sqlMgr/SqlMgr.ts @@ -172,6 +172,7 @@ export default class SqlMgr { args.folder = slash(this.currentProjectFolder); const projectJson = {...this.currentProjectJson, envs: {...this.currentProjectJson.envs}}; + // delete db credentials for (const env of Object.keys(projectJson.envs)) { projectJson.envs[env] = {...projectJson.envs[env], db: [...projectJson.envs[env].db]} for (let i = 0; i < projectJson.envs[env].db.length; i++) { @@ -181,10 +182,16 @@ export default class SqlMgr { database: projectJson.envs[env].db[i].connection.database } } - } } + + // remove meta db credentials + if (projectJson.meta?.db) delete projectJson.meta.db; + + // remove auth credentials + delete projectJson.auth; + args.projectJson = projectJson; data.data.list[0] = args; return data; @@ -1065,7 +1072,6 @@ export default class SqlMgr { } - public async projectChangeEnv(args) { try { const xcConfig = JSON.parse(fs.readFileSync(path.join(this.currentProjectFolder, 'config.xc.json'), 'utf8'));