Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ OPENAI_API_KEY=
# Custom domains
VERCEL_AUTH_TOKEN=
VERCEL_TEAM_ID=
VERCEL_PROJECT_ID=
VERCEL_PAGES_PROJECT_ID=

# Postmark Emails
POSTMARK_SERVER_KEY=
Expand Down
2 changes: 1 addition & 1 deletion apps/web/pages/api/pages/settings/add-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function addDomain(req: NextApiRequest, res: NextApiResponse) {
console.log("addDomain", user?.id, `domain: ${domain}`);

const response = await fetch(
`https://api.vercel.com/v8/projects/${process.env.VERCEL_PROJECT_ID}/domains?teamId=${process.env.VERCEL_TEAM_ID}`,
`https://api.vercel.com/v8/projects/${process.env.VERCEL_PAGES_PROJECT_ID}/domains?teamId=${process.env.VERCEL_TEAM_ID}`,
{
body: `{\n "name": "${domain}"\n}`,
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/pages/api/pages/settings/remove-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

console.log("removeDomain", user?.id, `domain: ${domain}`);

const response = await fetch(
`https://api.vercel.com/v8/projects/${process.env.VERCEL_PROJECT_ID}/domains/${domain}?teamId=${process.env.VERCEL_TEAM_ID}`,
`https://api.vercel.com/v8/projects/${process.env.VERCEL_PAGES_PROJECT_ID}/domains/${domain}?teamId=${process.env.VERCEL_TEAM_ID}`,
{
headers: {
Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`,
},
method: "DELETE",
}
);

Check failure

Code scanning / CodeQL

Server-side request forgery Critical

The
URL
of this request depends on a
user-provided value
.

await response.json();

Expand Down