From b7808b8f67ef48a59ee2e2673e2d2231b062983b Mon Sep 17 00:00:00 2001 From: Rajesh Date: Tue, 16 Aug 2022 14:23:29 +0530 Subject: [PATCH] Issue #SB-30708 #SB-30727 fix: Disable user on boarding workflow for managed user and SSO user --- src/app/client/src/app/app.component.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/app/client/src/app/app.component.ts b/src/app/client/src/app/app.component.ts index 022c8f2032e..b32cd1ead62 100644 --- a/src/app/client/src/app/app.component.ts +++ b/src/app/client/src/app/app.component.ts @@ -206,14 +206,19 @@ export class AppComponent implements OnInit, OnDestroy { this.setTagManager(); this.userService.userData$.subscribe((user: IUserData) => { - if (user.err) { - return throwError(user.err); - } - // If User is logged in and dob is missing, initiate consent workflow - if (!_.get(user, 'userProfile.dob') && this.userService.loggedIn) { - this.router.navigate(['/signup'], { queryParams: { loginMode: 'gmail' } }); - } - }); + if (user.err) { + return throwError(user.err); + } + // If User is logged in and dob is missing, initiate consent workflow + // Skip for managed users + // Skip for SSO users + if (!_.get(user, 'userProfile.dob') && + (this.userService.loggedIn && !_.get(user, 'userProfile.managedBy')) && + (_.isArray(user, 'userProfile.externalIds') && _.get(user, 'userProfile.externalIds').length === 0) + ) { + this.router.navigate(['/signup'], { queryParams: { loginMode: 'gmail' } }); + } + }); } setTagManager() {