From 8eb1c763378d8e48dea464d18db45f79dbaf3639 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 13 Jan 2026 05:12:19 +0000 Subject: [PATCH] fix: clean up api key validation --- src/commands/auth-choice.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/commands/auth-choice.ts b/src/commands/auth-choice.ts index 56df52234..e5d47b8c3 100644 --- a/src/commands/auth-choice.ts +++ b/src/commands/auth-choice.ts @@ -97,8 +97,11 @@ function normalizeApiKeyInput(raw: string): string { return withoutSemicolon.trim(); } -const validateApiKeyInput = (value: unknown) => - normalizeApiKeyInput(String(value ?? "")).length > 0 ? undefined : "Required"; +const validateApiKeyInput = (value: unknown) => { + const normalized = + typeof value === "string" ? normalizeApiKeyInput(value) : ""; + return normalized.length > 0 ? undefined : "Required"; +}; const validateRequiredInput = (value: string) => value.trim().length > 0 ? undefined : "Required";