fix: clean up api key validation
This commit is contained in:
@@ -97,8 +97,11 @@ function normalizeApiKeyInput(raw: string): string {
|
|||||||
return withoutSemicolon.trim();
|
return withoutSemicolon.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
const validateApiKeyInput = (value: unknown) =>
|
const validateApiKeyInput = (value: unknown) => {
|
||||||
normalizeApiKeyInput(String(value ?? "")).length > 0 ? undefined : "Required";
|
const normalized =
|
||||||
|
typeof value === "string" ? normalizeApiKeyInput(value) : "";
|
||||||
|
return normalized.length > 0 ? undefined : "Required";
|
||||||
|
};
|
||||||
|
|
||||||
const validateRequiredInput = (value: string) =>
|
const validateRequiredInput = (value: string) =>
|
||||||
value.trim().length > 0 ? undefined : "Required";
|
value.trim().length > 0 ? undefined : "Required";
|
||||||
|
|||||||
Reference in New Issue
Block a user