From 12ba436f4d9ac0a0228f644db602cbe4262fa5d9 Mon Sep 17 00:00:00 2001 From: mic Date: Fri, 9 Jan 2026 23:37:35 +0100 Subject: [PATCH] hiding api keys in the prompt log --- js/mzta-menus.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/mzta-menus.js b/js/mzta-menus.js index a74124ed..b164bae1 100644 --- a/js/mzta-menus.js +++ b/js/mzta-menus.js @@ -430,7 +430,13 @@ export class mzta_Menus { } }else{ // Classic prompts for the API webchat this.logger.log("fullPrompt: " + fullPrompt); - this.logger.log("curr_prompt: " + JSON.stringify(curr_prompt)); + this.logger.log("curr_prompt: " + JSON.stringify(curr_prompt, (key, value) => { + if (typeof key === 'string' && key.endsWith('_api_key')) { + return '****************'; + } + return value; + }) + ); this.openChatGPT(fullPrompt, curr_prompt.action, tabs[0].id, curr_prompt.name, curr_prompt.need_custom_text, curr_prompt); taWorkingStatus.stopWorking(); return {ok:'1'};