fix: hardcoded gitlab.com to gitlabUrl

This commit is contained in:
djknaeckebrot
2024-12-10 08:37:55 +01:00
parent f94ee8c299
commit 22e6d07f60

View File

@@ -7,13 +7,15 @@ export default async function handler(
) {
const { code, gitlabId } = req.query;
console.log("DEBUG: res.query: ", res);
if (!code || Array.isArray(code)) {
return res.status(400).json({ error: "Missing or invalid code" });
}
const gitlab = await findGitlabById(gitlabId as string);
const response = await fetch("https://gitlab.com/oauth/token", {
const response = await fetch(`${gitlab.gitlabUrl}/oauth/token`, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",