mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
fix(settings): prevent empty string API keys from being saved or preserved
- Add .min(1) validation to insertOpenrouterConfigSchema - Strip empty/whitespace-only apiKey before fallback to existing key - Return 400 if resulting apiKey is empty (forces user to enter valid key)
This commit is contained in:
1 parent
b7ef4940f7
commit
35cf21209f
2 files changed
+9
-2
No files matched your search
@@ -410,6 +410,8 @@ export const insertOpenrouterConfigSchema = createInsertSchema(openrouterConfig)
|
||||
id: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
}).extend({
|
||||
apiKey: z.string().min(1, "La clé API ne peut pas être vide"),
|
||||
});
|
||||
|
||||
export const updateOpenrouterConfigSchema = insertOpenrouterConfigSchema.partial({
|
||||
|
||||
Reference in new issue
Block a user