From dd42b6079f3b2663a06c97b7e2cb3be87bffb485 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Sun, 5 Apr 2026 19:28:43 -0500 Subject: [PATCH] fix(mosaic): mask password input in TUI login prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The TUI login flow used a plain readline.question() for the password prompt, which echoed characters to the terminal. Replaced with the existing promptSecret() helper that uses TTY raw mode to suppress echo — the same function already used by `mosaic gateway login`. Co-Authored-By: Claude Opus 4.6 --- packages/mosaic/src/cli.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/mosaic/src/cli.ts b/packages/mosaic/src/cli.ts index a40b47f..30efbdc 100644 --- a/packages/mosaic/src/cli.ts +++ b/packages/mosaic/src/cli.ts @@ -135,15 +135,11 @@ program // No valid session — prompt for credentials if (!session) { - const readline = await import('node:readline'); - const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); - const ask = (q: string): Promise => - new Promise((resolve) => rl.question(q, resolve)); + const { promptLine, promptSecret } = await import('./commands/gateway/login.js'); console.log(`Sign in to ${opts.gateway}`); - const email = await ask('Email: '); - const password = await ask('Password: '); - rl.close(); + const email = await promptLine('Email: '); + const password = await promptSecret('Password: '); try { const auth = await signIn(opts.gateway, email, password); -- 2.49.1