From 8d727607c091825fafdf20021c0c49f8f479bd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Simi=C4=87?= Date: Wed, 19 Aug 2020 20:10:40 +0200 Subject: [PATCH] Use specified instance domain Use specified instance domain instead of gitlab.com. --- static/scripts.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/static/scripts.js b/static/scripts.js index b344fca..4f70231 100644 --- a/static/scripts.js +++ b/static/scripts.js @@ -621,8 +621,7 @@ async function verifyProof(url, fingerprint) { match = url.match(/https:\/\/(.*)\/(.*)\/gitlab_proof/); output.display = match[2]; output.url = `https://${match[1]}/${match[2]}`; - output.proofUrlFetch = `https://gitlab.com/api/v4/users?username=${match[2]}`; - // output.proofUrlFetch = `https://gitlab.com/api/v4/projects?custom_attributes[search]=${match[2]}/gitlab_proof&custom_attributes[search_namespaces]=true`; + output.proofUrlFetch = `https://${match[1]}/api/v4/users?username=${match[2]}`; try { const opts = { headers: { @@ -641,7 +640,7 @@ async function verifyProof(url, fingerprint) { throw new Error('No user with username ' + match[2]); } // Get project - output.proofUrlFetch = `https://gitlab.com/api/v4/users/${user.id}/projects`; + output.proofUrlFetch = `https://${match[1]}/api/v4/users/${user.id}/projects`; response = await fetch(output.proofUrlFetch, opts); if (!response.ok) { throw new Error('Response failed: ' + response.status);