fix(mosaic): mask password input in TUI login prompt (#449)
This commit was merged in pull request #449.
This commit is contained in:
@@ -135,15 +135,11 @@ program
|
|||||||
|
|
||||||
// No valid session — prompt for credentials
|
// No valid session — prompt for credentials
|
||||||
if (!session) {
|
if (!session) {
|
||||||
const readline = await import('node:readline');
|
const { promptLine, promptSecret } = await import('./commands/gateway/login.js');
|
||||||
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
||||||
const ask = (q: string): Promise<string> =>
|
|
||||||
new Promise((resolve) => rl.question(q, resolve));
|
|
||||||
|
|
||||||
console.log(`Sign in to ${opts.gateway}`);
|
console.log(`Sign in to ${opts.gateway}`);
|
||||||
const email = await ask('Email: ');
|
const email = await promptLine('Email: ');
|
||||||
const password = await ask('Password: ');
|
const password = await promptSecret('Password: ');
|
||||||
rl.close();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const auth = await signIn(opts.gateway, email, password);
|
const auth = await signIn(opts.gateway, email, password);
|
||||||
|
|||||||
Reference in New Issue
Block a user