fix: redact apiKey from getAll AI endpoint to prevent credential exposure

This commit is contained in:
Yash Kumar
2026-09-21 00:30:38 +05:30
parent 293e19703a
commit bdefc02e77
+2 -1
View File
@@ -195,9 +195,10 @@ export const aiRouter = createTRPCRouter({
getAll: withAnyPermission("ai", ["read", "create", "update", "delete"]).query(
async ({ ctx }) => {
return await getAiSettingsByOrganizationId(
const settings = await getAiSettingsByOrganizationId(
ctx.session.activeOrganizationId,
);
return settings.map(({ apiKey, ...rest }) => rest);
},
),