diff --git a/plugins/slack/server/auth/slack.ts b/plugins/slack/server/auth/slack.ts index 5fc7285b7..f7e5b59ed 100644 --- a/plugins/slack/server/auth/slack.ts +++ b/plugins/slack/server/auth/slack.ts @@ -171,7 +171,9 @@ if (env.SLACK_CLIENT_ID && env.SLACK_CLIENT_SECRET) { switch (type) { case IntegrationType.Post: { - const collection = await Collection.findByPk(collectionId, { + const collection = await Collection.scope({ + method: ["withMembership", user.id], + }).findByPk(collectionId, { rejectOnEmpty: true, }); authorize(user, "read", collection);