From 1aa4258b3a0205da3932f9a86fcf31e415037e17 Mon Sep 17 00:00:00 2001
From: andrej romanov <50377758+auumgn@users.noreply.github.com>
Date: Thu, 4 Apr 2024 18:03:26 +0300
Subject: [PATCH 1/2] add protocol to orcid base url
---
ui/src/app/affiliation/affiliations.component.html | 4 ++--
ui/src/app/app.constants.ts | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/src/app/affiliation/affiliations.component.html b/ui/src/app/affiliation/affiliations.component.html
index c2e988281..58be543d5 100644
--- a/ui/src/app/affiliation/affiliations.component.html
+++ b/ui/src/app/affiliation/affiliations.component.html
@@ -158,8 +158,8 @@
https://{{ orcidBaseUrl }}/{{ affiliation.orcidId }}{{ orcidBaseUrl }}/{{ affiliation.orcidId }}
diff --git a/ui/src/app/app.constants.ts b/ui/src/app/app.constants.ts
index 924c6d581..b9510acca 100644
--- a/ui/src/app/app.constants.ts
+++ b/ui/src/app/app.constants.ts
@@ -41,7 +41,7 @@ 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 = environment + '.orcid.org'
+export const ORCID_BASE_URL = 'https://' + environment + '.orcid.org'
// eslint-disable-next-line
export const EMAIL_REGEXP = /^([^@\s]|(".+"))+@([^@\s\."'\(\)\[\]\{\}\\/,:;]+\.)+([^@\s\."'\(\)\[\]\{\}\\/,:;]{2,})+$/
From 317147603321a1f1863de49549425a5bc97a01a7 Mon Sep 17 00:00:00 2001
From: andrej romanov <50377758+auumgn@users.noreply.github.com>
Date: Thu, 4 Apr 2024 18:05:24 +0300
Subject: [PATCH 2/2] add protocol to tests
---
ui/src/app/landing-page/landing-page.component.spec.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/src/app/landing-page/landing-page.component.spec.ts b/ui/src/app/landing-page/landing-page.component.spec.ts
index 42e67adaa..11e501696 100644
--- a/ui/src/app/landing-page/landing-page.component.spec.ts
+++ b/ui/src/app/landing-page/landing-page.component.spec.ts
@@ -55,7 +55,7 @@ describe('LandingPageComponent', () => {
component.processRequest('someState', '', '')
expect(landingPageService.getOrcidConnectionRecord).toHaveBeenCalled()
expect(component.oauthUrl).toBe(
- 'localhost.orcid.org/oauth/authorize?response_type=token&redirect_uri=/landing-page&client_id=name&scope=/read-limited /activities/update /person/update openid&prompt=login&state=someState'
+ 'https://localhost.orcid.org/oauth/authorize?response_type=token&redirect_uri=/landing-page&client_id=name&scope=/read-limited /activities/update /person/update openid&prompt=login&state=someState'
)
expect(landingPageService.getPublicKey).toHaveBeenCalledTimes(0)
expect(windowLocationService.updateWindowLocation).toHaveBeenCalled()
@@ -72,7 +72,7 @@ describe('LandingPageComponent', () => {
component.processRequest('someState', '', '')
expect(landingPageService.getOrcidConnectionRecord).toHaveBeenCalled()
expect(component.oauthUrl).toBe(
- 'localhost.orcid.org/oauth/authorize?response_type=token&redirect_uri=/landing-page&client_id=name&scope=/read-limited /activities/update /person/update openid&prompt=login&state=someState'
+ 'https://localhost.orcid.org/oauth/authorize?response_type=token&redirect_uri=/landing-page&client_id=name&scope=/read-limited /activities/update /person/update openid&prompt=login&state=someState'
)
expect(landingPageService.getPublicKey).toHaveBeenCalledTimes(0)
expect(windowLocationService.updateWindowLocation).toHaveBeenCalledTimes(0)
@@ -92,7 +92,7 @@ describe('LandingPageComponent', () => {
component.processRequest('someState', '', '')
expect(landingPageService.getOrcidConnectionRecord).toHaveBeenCalled()
expect(component.oauthUrl).toBe(
- 'localhost.orcid.org/oauth/authorize?response_type=token&redirect_uri=/landing-page&client_id=name&scope=/read-limited /activities/update /person/update openid&prompt=login&state=someState'
+ 'https://localhost.orcid.org/oauth/authorize?response_type=token&redirect_uri=/landing-page&client_id=name&scope=/read-limited /activities/update /person/update openid&prompt=login&state=someState'
)
expect(landingPageService.getPublicKey).toHaveBeenCalledTimes(0)
expect(windowLocationService.updateWindowLocation).toHaveBeenCalledTimes(0)