Skip to content

Commit

Permalink
Use EFFECTIVE_USER_ORCID instead of REAL_USER_ORCID to avoid problems…
Browse files Browse the repository at this point in the history
… when doing delegation mode
  • Loading branch information
amontenegro committed Jul 28, 2022
1 parent a93299e commit f27c6cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function getContributor(): Contributor[] {
function getUserRecord(): UserRecord {
return {
userInfo: {
REAL_USER_ORCID: '0000-0000-0000-000X',
EFFECTIVE_USER_ORCID: '0000-0000-0000-000X',
},
} as UserRecord
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class WorkContributorRolesComponent implements OnInit {
private getRecordHolderContribution(): Contributor {
return this.contributors?.find(
(c) =>
c?.contributorOrcid?.path === this.userRecord?.userInfo?.REAL_USER_ORCID
c?.contributorOrcid?.path === this.userRecord?.userInfo?.EFFECTIVE_USER_ORCID
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export class WorkContributorsComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.id = this.userRecord?.userInfo?.REAL_USER_ORCID
// EFFECTIVE_USER_ORCID keeps the ORCID id of the user you are on.
// REAL_USER_ORCID will contain the orcid id of a delegator when on delegation mode.
this.id = this.userRecord?.userInfo?.EFFECTIVE_USER_ORCID
this.platform
.get()
.pipe(takeUntil(this.$destroy))
Expand Down

0 comments on commit f27c6cd

Please sign in to comment.