Skip to content

Commit

Permalink
9489-qa-email-domains-interstitial-shown-to-user-with-at-least-one-pu…
Browse files Browse the repository at this point in the history
…blic-email-domain
  • Loading branch information
leomendoza123 committed Nov 11, 2024
1 parent 72a954b commit a58e91b
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 a58e91b

Please sign in to comment.