mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-14 07:55:18 +00:00
chore: drop explanatory comments in github setup handler
This commit is contained in:
@@ -23,9 +23,6 @@ export default async function handler(
|
|||||||
return res.status(400).json({ error: "Missing code parameter" });
|
return res.status(400).json({ error: "Missing code parameter" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// This callback performs privileged writes (persisting App secrets, re-pointing
|
|
||||||
// installations) but sits outside tRPC, so it must authenticate and authorize
|
|
||||||
// on its own. The write target is derived from the session, never from `state`.
|
|
||||||
const { user, session } = await validateRequest(req);
|
const { user, session } = await validateRequest(req);
|
||||||
if (!user || !session?.activeOrganizationId) {
|
if (!user || !session?.activeOrganizationId) {
|
||||||
return res.status(401).json({ error: "Unauthorized" });
|
return res.status(401).json({ error: "Unauthorized" });
|
||||||
@@ -36,8 +33,6 @@ export default async function handler(
|
|||||||
};
|
};
|
||||||
|
|
||||||
const [action] = state?.split(":") ?? [];
|
const [action] = state?.split(":") ?? [];
|
||||||
// gh_init creates a provider, gh_setup re-points an existing one; both require
|
|
||||||
// the gitProviders permission (the same guard the tRPC github router uses).
|
|
||||||
if (!(await hasPermission(ctx, { gitProviders: ["create"] }))) {
|
if (!(await hasPermission(ctx, { gitProviders: ["create"] }))) {
|
||||||
return res.status(403).json({ error: "Forbidden" });
|
return res.status(403).json({ error: "Forbidden" });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user