Skip to content

Commit

Permalink
singin-interstitial
Browse files Browse the repository at this point in the history
  • Loading branch information
leomendoza123 committed Nov 25, 2024
1 parent 6035557 commit 0bb1cb9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
10 changes: 5 additions & 5 deletions src/app/authorize/pages/authorize/authorize.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ export class AuthorizeComponent {
if (
url &&
this.userHasPrivateDomains &&
!this.userHasPublicDomains
// this.oauthDomainsInterstitialEnabled &&
// !this.domainInterstitialHasBeenViewed &&
// this.userIsNotImpersonating &&
// !this.insidePopUpWindows
!this.userHasPublicDomains &&
this.oauthDomainsInterstitialEnabled &&
!this.domainInterstitialHasBeenViewed &&
this.userIsNotImpersonating &&
!this.insidePopUpWindows
) {
this.showAuthorizationComponent = false
this.showInterstital = true
Expand Down
60 changes: 32 additions & 28 deletions src/app/core/login-interstitials/login-interstitials.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { TogglzService } from '../togglz/togglz.service'
export class LoginInterstitialsService {
alreadySawSignDomainInterstitial: boolean
loginDomainsInterstitialEnabled: boolean
alreadyCheckLoginInterstitials: boolean
constructor(
private _matDialog: MatDialog,
private interstitialService: InterstitialsService,
Expand All @@ -36,37 +37,40 @@ export class LoginInterstitialsService {
}

checkLoginInterstitials(userRecord: UserRecord): Observable<string[]> | void {
let isNotImpersonating
if (userRecord.userInfo) {
isNotImpersonating =
userRecord.userInfo.REAL_USER_ORCID ===
userRecord.userInfo.EFFECTIVE_USER_ORCID
}
if (
// isNotImpersonating &&
userRecord.emails &&
userRecord.emails.emailDomains &&
!this.userHasPublicDomains(userRecord.emails) &&
this.userHasPrivateDomains(userRecord.emails) &&
// this.loginDomainsInterstitialEnabled &&
!this.alreadySawSignDomainInterstitial
userRecord?.userInfo &&
userRecord?.emails?.emailDomains &&
!this.alreadyCheckLoginInterstitials
) {
this.alreadySawSignDomainInterstitial = true
this.interstitialService
.setInterstitialsViewed('SIGN_IN_DOMAIN_INTERSTITIAL')
.subscribe()
const data: ShareEmailsDomainsComponentDialogInput = {
userEmailsJson: userRecord.emails,
}
this.alreadyCheckLoginInterstitials = true
const isNotImpersonating =
userRecord.userInfo.REAL_USER_ORCID ===
userRecord.userInfo.EFFECTIVE_USER_ORCID

const dialog = this._matDialog.open(ShareEmailsDomainsDialogComponent, {
data,
width: '580px',
disableClose: true,
autoFocus: false,
restoreFocus: false,
})
return dialog.afterClosed()
if (
// isNotImpersonating &&
!this.userHasPublicDomains(userRecord.emails) &&
this.userHasPrivateDomains(userRecord.emails) &&
// this.loginDomainsInterstitialEnabled &&
!this.alreadySawSignDomainInterstitial
) {
this.alreadySawSignDomainInterstitial = true
this.interstitialService
.setInterstitialsViewed('SIGN_IN_DOMAIN_INTERSTITIAL')
.subscribe()
const data: ShareEmailsDomainsComponentDialogInput = {
userEmailsJson: userRecord.emails,
}

const dialog = this._matDialog.open(ShareEmailsDomainsDialogComponent, {
data,
width: '580px',
disableClose: true,
autoFocus: false,
restoreFocus: false,
})
return dialog.afterClosed()
}
}
}

Expand Down

0 comments on commit 0bb1cb9

Please sign in to comment.