From 217e5b6fa706c4c0c05ba10fcbc722c1e7a0726b Mon Sep 17 00:00:00 2001
From: George Nash
- {{ issuer }}/{{ orcidRecord.orcid }}
-
{{ incorrectDataMessage }}
diff --git a/ui/src/app/landing-page/landing-page.component.ts b/ui/src/app/landing-page/landing-page.component.ts index 49e069fd4..478ab4b8d 100644 --- a/ui/src/app/landing-page/landing-page.component.ts +++ b/ui/src/app/landing-page/landing-page.component.ts @@ -7,6 +7,7 @@ import { MemberService } from '../member/service/member.service' import { IMember } from '../member/model/member.model' import { ORCID_BASE_URL } from '../app.constants' import { WindowLocationService } from '../shared/service/window-location.service' +import { OrcidRecord } from '../shared/model/orcid-record.model' @Component({ selector: 'app-landing-page', @@ -27,9 +28,8 @@ export class LandingPageComponent implements OnInit { clientName: string | undefined salesforceId: string | undefined clientId: string | undefined - orcidId: string | undefined oauthUrl: string | undefined - orcidRecord: any + orcidRecord: OrcidRecord | undefined signedInIdToken: any givenName: string | undefined familyName: string | undefined @@ -58,11 +58,17 @@ export class LandingPageComponent implements OnInit { } processRequest(state_param: string, id_token_fragment: string, access_token_fragment: string) { + console.log('process request method, calling this.landingPageService.getOrcidConnectionRecord') + this.landingPageService.getOrcidConnectionRecord(state_param).subscribe({ next: (result) => { + console.log('got orcid record result: ', result) + this.orcidRecord = result this.landingPageService.getMemberInfo(state_param).subscribe({ next: (res: IMember) => { + console.log('got member data') + this.clientName = res.clientName this.clientId = res.clientId this.salesforceId = res.salesforceId @@ -82,6 +88,8 @@ export class LandingPageComponent implements OnInit { // Check if id token exists in URL (user just granted permission) if (id_token_fragment != null && id_token_fragment !== '') { + console.log('checking submit token') + this.checkSubmitToken(id_token_fragment, state_param, access_token_fragment) } else { const error = this.getFragmentParameterByName('error') @@ -154,6 +162,9 @@ export class LandingPageComponent implements OnInit { return } if (data.isSameUserThatAlreadyGranted) { + console.log('same user has already granted access. this.orcidRecord is ', this.orcidRecord) + console.log('this.orcidRecord.orcidId is ', this.orcidRecord?.orcid) + this.showConnectionExistsElement() return }