diff --git a/setup/auto.ts b/setup/auto.ts index 4dee7c8..2f333a3 100644 --- a/setup/auto.ts +++ b/setup/auto.ts @@ -706,6 +706,7 @@ async function runPasteAuth(method: 'oauth' | 'api'): Promise { const answer = ensureAnswer( await p.password({ message: `Paste your ${label}`, + clearOnError: true, validate: (v) => { if (!v || !v.trim()) return 'Required'; if (!v.trim().startsWith(prefix)) { diff --git a/setup/channels/discord.ts b/setup/channels/discord.ts index 3668686..74bc9af 100644 --- a/setup/channels/discord.ts +++ b/setup/channels/discord.ts @@ -242,6 +242,7 @@ async function collectDiscordToken(): Promise { const answer = ensureAnswer( await p.password({ message: 'Paste your bot token', + clearOnError: true, validate: (v) => { const t = (v ?? '').trim(); if (!t) return 'Token is required'; diff --git a/setup/channels/imessage.ts b/setup/channels/imessage.ts index d8b129f..fae9fe4 100644 --- a/setup/channels/imessage.ts +++ b/setup/channels/imessage.ts @@ -250,6 +250,7 @@ async function collectRemoteCreds(): Promise { const keyAnswer = ensureAnswer( await p.password({ message: 'Photon API key', + clearOnError: true, validate: (v) => ((v ?? '').trim() ? undefined : 'API key is required'), }), ); diff --git a/setup/channels/slack.ts b/setup/channels/slack.ts index 6d1ff56..9ae86ae 100644 --- a/setup/channels/slack.ts +++ b/setup/channels/slack.ts @@ -154,6 +154,7 @@ async function collectBotToken(): Promise { const answer = ensureAnswer( await p.password({ message: 'Paste your Slack bot token', + clearOnError: true, validate: (v) => { const t = (v ?? '').trim(); if (!t) return 'Token is required'; @@ -175,6 +176,7 @@ async function collectSigningSecret(): Promise { const answer = ensureAnswer( await p.password({ message: 'Paste your Slack signing secret', + clearOnError: true, validate: (v) => { const t = (v ?? '').trim(); if (!t) return 'Signing secret is required'; diff --git a/setup/channels/teams.ts b/setup/channels/teams.ts index fb4d878..2b892bf 100644 --- a/setup/channels/teams.ts +++ b/setup/channels/teams.ts @@ -276,6 +276,7 @@ async function stepClientSecret(args: { const answer = ensureAnswer( await p.password({ message: 'Paste the client secret Value', + clearOnError: true, validate: validateWithHelpEscape((v) => { const t = (v ?? '').trim(); if (!t) return 'Required'; diff --git a/setup/channels/telegram.ts b/setup/channels/telegram.ts index df97fcf..3c670e6 100644 --- a/setup/channels/telegram.ts +++ b/setup/channels/telegram.ts @@ -150,6 +150,7 @@ async function collectTelegramToken(): Promise { const answer = ensureAnswer( await p.password({ message: 'Paste your bot token', + clearOnError: true, validate: (v) => { if (!v || !v.trim()) return "Token is required"; if (!/^[0-9]+:[A-Za-z0-9_-]{35,}$/.test(v.trim())) { diff --git a/setup/lib/setup-config-screen.ts b/setup/lib/setup-config-screen.ts index ad8ae62..88b10d5 100644 --- a/setup/lib/setup-config-screen.ts +++ b/setup/lib/setup-config-screen.ts @@ -115,7 +115,7 @@ async function promptOne(e: Entry, values: ConfigValues): Promise { }; const ans = ensureAnswer( e.secret - ? await p.password({ message: e.label, validate }) + ? await p.password({ message: e.label, clearOnError: true, validate }) : await p.text({ message: e.label, placeholder: e.placeholder ?? e.default,