(apiKey: string)
| 1137 | ) |
| 1138 | |
| 1139 | function isValidApiKey(apiKey: string): boolean { |
| 1140 | // Only allow alphanumeric characters, dashes, and underscores |
| 1141 | return /^[a-zA-Z0-9-_]+$/.test(apiKey) |
| 1142 | } |
| 1143 | |
| 1144 | export async function saveApiKey(apiKey: string): Promise<void> { |
| 1145 | if (!isValidApiKey(apiKey)) { |