Skip to content

Commit

Permalink
Merge pull request #2391 from ORCID/lmendoza/9489-qa-email-domains-in…
Browse files Browse the repository at this point in the history
…terstitial-shown-to-user-with-at-least-one-public-email-domain

9489-qa-email-domains-interstitial-shown-to-user-with-at-least-one-pu…
  • Loading branch information
leomendoza123 authored Nov 11, 2024
2 parents 72a954b + a58e91b commit ad279dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/authorize/pages/authorize/authorize.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class AuthorizeComponent {
domainInterstitialHasBeenViewed: boolean
userIsNotImpersonating: boolean
insidePopUpWindows: boolean
userHasPublicDomains: boolean

constructor(
_user: UserService,
Expand Down Expand Up @@ -75,11 +76,15 @@ export class AuthorizeComponent {
tap((value) => {
this.originalEmailsBackendCopy = cloneDeep(value)
this.userHasPrivateDomains = this.userHasPrivateEmails(value)
this.userHasPublicDomains= this.userHasPublicEmails(value)
}),
first()
)
.subscribe()
}
userHasPublicEmails(value: EmailsEndpoint): any {
return !!value.emailDomains.find((domain) => domain.visibility === 'PUBLIC')
}

userHasPrivateEmails(value: EmailsEndpoint): boolean {
return !!value.emailDomains.find((domain) => domain.visibility !== 'PUBLIC')
Expand All @@ -90,6 +95,7 @@ export class AuthorizeComponent {
if (
url &&
this.userHasPrivateDomains &&
!this.userHasPublicDomains &&
this.oauthDomainsInterstitialEnabled &&
!this.domainInterstitialHasBeenViewed &&
this.userIsNotImpersonating &&
Expand Down

0 comments on commit ad279dc

Please sign in to comment.