Skip to content

Commit d382df6

Browse files
authored
fix(slack): only parse scoped user id for oauth credentials (#4781)
* fix(slack): only parse scoped user id for oauth credentials * chore(slack): trim guard comment
1 parent 7e0c77c commit d382df6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • apps/sim/app/api/tools/slack/channels

apps/sim/app/api/tools/slack/channels/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
9393
accessToken = resolvedToken
9494
logger.info('Using OAuth token for Slack API')
9595

96-
if (authz.resolvedCredentialId) {
96+
// resolvedCredentialId is an account.id only for OAuth credentials
97+
// (the service_account path returns a credential.id).
98+
if (authz.credentialType === 'oauth' && authz.resolvedCredentialId) {
9799
const [accountRow] = await db
98100
.select({ accountId: account.accountId })
99101
.from(account)

0 commit comments

Comments
 (0)