Skip to content

Commit ab695c8

Browse files
committed
fix bugbot comment
1 parent c4d51ef commit ab695c8

File tree

1 file changed

+6
-1
lines changed
  • apps/sim/app/api/auth/oauth/credentials

1 file changed

+6
-1
lines changed

apps/sim/app/api/auth/oauth/credentials/route.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ export async function GET(request: NextRequest) {
113113

114114
let accountsData
115115

116-
if (credentialId) {
116+
if (credentialId && workflowId) {
117+
// When both workflowId and credentialId are provided, fetch by ID only.
118+
// Workspace authorization above already proves access; the credential
119+
// may belong to another workspace member (e.g. for display name resolution).
120+
accountsData = await db.select().from(account).where(eq(account.id, credentialId))
121+
} else if (credentialId) {
117122
accountsData = await db
118123
.select()
119124
.from(account)

0 commit comments

Comments
 (0)