From df1b84ec2bdf9f7dbb833341d57e7342c780dd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20L=C3=B3pez=20Dato?= Date: Mon, 21 Oct 2024 09:16:12 -0300 Subject: [PATCH] fix: Frontend error when creating SAML configuration if API URL is relative (#4751) --- frontend/web/components/modals/CreateSAML.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/web/components/modals/CreateSAML.tsx b/frontend/web/components/modals/CreateSAML.tsx index 1cec348fa40b..6ee7145d39d5 100644 --- a/frontend/web/components/modals/CreateSAML.tsx +++ b/frontend/web/components/modals/CreateSAML.tsx @@ -55,7 +55,10 @@ const CreateSAML: FC = ({ organisationId, samlName }) => { { skip: !samlName }, ) - const acsUrl = new URL(`/auth/saml/${name}/response/`, Project.api).href + const acsUrl = new URL( + `./auth/saml/${name}/response/`, + new Request(Project.api).url, // Project.api can be relative, e.g. /api/v1/ + ).href const copyAcsUrl = async () => { await navigator.clipboard.writeText(acsUrl) toast('Copied to clipboard')