From 30edd7bef64760a6a2e09fd400b6892b808c6b05 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Tue, 6 Aug 2024 21:55:54 +0300 Subject: [PATCH] fix orcid base url fix --- ui/src/app/app.constants.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/src/app/app.constants.ts b/ui/src/app/app.constants.ts index 7e5e75c72..5d7d7747e 100644 --- a/ui/src/app/app.constants.ts +++ b/ui/src/app/app.constants.ts @@ -49,8 +49,16 @@ export function emailValidator(control: FormControl): { [key: string]: any } | n } return null } -const environment = window.location.hostname.replace('member-portal.', '').replace('.orcid.org', '') -export const ORCID_BASE_URL = 'https://' + environment + '.orcid.org' + +let environment = '' +if (window.location.hostname == 'member-portal.qa.orcid.org') { + environment = 'qa' +} else if (window.location.hostname == 'member-portal.sandbox.orcid.org') { + environment = 'sandbox' +} + +export const ORCID_BASE_URL = 'https://' + environment + 'orcid.org' + export const BASE_URL = window.location.origin // eslint-disable-next-line