Skip to content

Commit 384ec4e

Browse files
authored
Merge pull request #2538 from ORCID/leo/fix-oauth-automation
Leo/fix oauth automation
2 parents 919c0ce + 58aac74 commit 384ec4e

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/app/authorize/pages/authorize/authorize.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ export class AuthorizeComponent {
6363
private userService: UserService,
6464
private platformInfoService: PlatformInfoService,
6565
@Inject(WINDOW) private window: Window,
66-
private googleTagManagerService: GoogleTagManagerService,
67-
private errorHandlerService: ErrorHandlerService,
6866
private recordService: RecordService,
6967
private loginMainInterstitialsManagerService: LoginMainInterstitialsManagerService
7068
) {}
@@ -221,8 +219,9 @@ export class AuthorizeComponent {
221219
session: UserSession
222220
): Observable<UserSession> {
223221
return this.recordService.getRecord({}).pipe(
224-
// Only proceed if the record has userInfo, emails, and at least one affiliation
225-
filter((rec: UserRecord) => !!rec && !!rec.userInfo),
222+
filter((rec: UserRecord) =>
223+
this.loginMainInterstitialsManagerService.isValidUserRecord(rec)
224+
),
226225
take(1),
227226
switchMap((validRecord) =>
228227
this.loginMainInterstitialsManagerService

src/app/core/login-interstitials-manager/login-main-interstitials-manager.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export class LoginMainInterstitialsManagerService {
162162
/**
163163
* Valid user check & ensures not impersonating
164164
*/
165-
private isValidUserRecord(userRecord: UserRecord): boolean {
165+
isValidUserRecord(userRecord: UserRecord): boolean {
166166
if (
167167
!userRecord?.userInfo ||
168168
!userRecord?.emails ||

0 commit comments

Comments
 (0)