mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
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
This commit is contained in:
@@ -93,7 +93,9 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
|
||||
accessToken = resolvedToken
|
||||
logger.info('Using OAuth token for Slack API')
|
||||
|
||||
if (authz.resolvedCredentialId) {
|
||||
// resolvedCredentialId is an account.id only for OAuth credentials
|
||||
// (the service_account path returns a credential.id).
|
||||
if (authz.credentialType === 'oauth' && authz.resolvedCredentialId) {
|
||||
const [accountRow] = await db
|
||||
.select({ accountId: account.accountId })
|
||||
.from(account)
|
||||
|
||||
Reference in New Issue
Block a user