mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
chore: Consistent policy checks in integration callbacks (#14221)
This commit is contained in:
1 parent
45bf9e290c
commit
cf578accf9
8 files changed
+79
-4
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user