We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e0c77c commit 0d019dcCopy full SHA for 0d019dc
1 file changed
apps/sim/app/api/tools/slack/channels/route.ts
@@ -93,7 +93,11 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
93
accessToken = resolvedToken
94
logger.info('Using OAuth token for Slack API')
95
96
- if (authz.resolvedCredentialId) {
+ // resolvedCredentialId is an account.id only for OAuth credentials; the
97
+ // service_account path returns a credential.id, which must not be used as
98
+ // an account lookup key. Slack never uses service accounts, but guard
99
+ // explicitly so the lookup is correct by construction.
100
+ if (authz.credentialType === 'oauth' && authz.resolvedCredentialId) {
101
const [accountRow] = await db
102
.select({ accountId: account.accountId })
103
.from(account)
0 commit comments