chore: Consistent policy checks in integration callbacks (#14221)

This commit is contained in:
Tom Moor authored and GitHub committed 2026-10-22 07:27:12 -04:00
1 parent 45bf9e290c
commit cf578accf9
8 files changed
+79 -4

No files matched your search

+2
View File
@@ -9,6 +9,7 @@ import { transaction } from "@server/middlewares/transaction";
import validate from "@server/middlewares/validate";
import validateWebhook from "@server/middlewares/validateWebhook";
import { IntegrationAuthentication, Integration } from "@server/models";
import { authorize } from "@server/policies";
import type { APIContext } from "@server/types";
import { verifyOAuthStateNonce } from "@server/utils/oauth";
import { RequestHelper } from "@server/utils/RequestHelper";
@@ -61,6 +62,7 @@ router.get(
}
verifyOAuthStateNonce(ctx, GitHubOAuthNonceCookie, parsedState.nonce);
authorize(user, "createIntegration", user.team);
const client = await GitHub.authenticateAsUser(code!, state);
const installationsByUser = await client.requestAppInstallations();