diff --git a/packages/console/app/src/routes/zen/util/handler.ts b/packages/console/app/src/routes/zen/util/handler.ts index e34704f98..7d7767b8d 100644 --- a/packages/console/app/src/routes/zen/util/handler.ts +++ b/packages/console/app/src/routes/zen/util/handler.ts @@ -588,7 +588,7 @@ export async function handler( tx .update(KeyTable) .set({ timeUsed: sql`now()` }) - .where(eq(KeyTable.id, authInfo.apiKeyId)), + .where(and(eq(KeyTable.workspaceID, authInfo.workspaceID), eq(KeyTable.id, authInfo.apiKeyId))), ) }