diff --git a/apps/dokploy/components/dashboard/settings/git/add-github-provider.tsx b/apps/dokploy/components/dashboard/settings/git/add-github-provider.tsx index ecf766760..914d03385 100644 --- a/apps/dokploy/components/dashboard/settings/git/add-github-provider.tsx +++ b/apps/dokploy/components/dashboard/settings/git/add-github-provider.tsx @@ -27,13 +27,13 @@ export const AddGithubProvider = () => { const url = document.location.origin; const manifest = JSON.stringify( { - redirect_url: `${origin}/api/providers/github/redirect?authId=${data?.id}`, + redirect_url: `${origin}/api/providers/github/setup?authId=${data?.id}`, name: `Dokploy-${format(new Date(), "yyyy-MM-dd")}`, url: origin, hook_attributes: { url: `${url}/api/deploy/github`, }, - callback_urls: [`${origin}/api/providers/github/redirect`], + callback_urls: [`${origin}/api/providers/github/setup`], public: false, request_oauth_on_install: true, default_permissions: { diff --git a/apps/dokploy/pages/api/deploy/github.ts b/apps/dokploy/pages/api/deploy/github.ts index 1c22b9c09..b29e5ba68 100644 --- a/apps/dokploy/pages/api/deploy/github.ts +++ b/apps/dokploy/pages/api/deploy/github.ts @@ -22,6 +22,11 @@ export default async function handler( const signature = req.headers["x-hub-signature-256"]; const github = req.body; + if(!github?.installation.id) { + res.status(400).json({ message: "Github Installation not found" }); + return; + } + const githubResult = await db.query.githubProvider.findFirst({ where: eq(githubProvider.githubInstallationId, github.installation.id), }); diff --git a/apps/dokploy/pages/api/providers/github/redirect.ts b/apps/dokploy/pages/api/providers/github/setup.ts similarity index 100% rename from apps/dokploy/pages/api/providers/github/redirect.ts rename to apps/dokploy/pages/api/providers/github/setup.ts