Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

add logging

Max Deichmanna1598a2828c6
diff --git a/src/features/public-api/server/apiAuth.ts b/src/features/public-api/server/apiAuth.ts
index 790684ccc7..a7ea07e8f0 100644
--- a/src/features/public-api/server/apiAuth.ts
+++ b/src/features/public-api/server/apiAuth.ts
@@ -50,7 +50,11 @@ export async function verifyAuthHeaderAndReturnScope(
secretKey,
dbKey.hashedSecretKey,
);
- if (!isValid) throw new Error("Invalid credentials");
+
+ if (!isValid) {
+ console.log("Old key is invalid", publicKey);
+ throw new Error("Invalid credentials");
+ }
const shaKey = createShaHash(secretKey, salt);
@@ -63,7 +67,10 @@ export async function verifyAuthHeaderAndReturnScope(
projectId = dbKey.projectId;
}
- if (!projectId) throw new Error("Invalid credentials");
+ if (!projectId) {
+ console.log("No project id found for key", publicKey);
+ throw new Error("Invalid credentials");
+ }
return {
validKey: true,