From 9ea7bee106130914394fd352fa82130860afc4f2 Mon Sep 17 00:00:00 2001 From: Afnan C <98315899+Cafnanc@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:00:04 +0530 Subject: [PATCH 1/2] Update home.page.ts --- src/app/pages/tabs/home/home.page.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/pages/tabs/home/home.page.ts b/src/app/pages/tabs/home/home.page.ts index 491cc1e7d..fc8a7f060 100644 --- a/src/app/pages/tabs/home/home.page.ts +++ b/src/app/pages/tabs/home/home.page.ts @@ -65,6 +65,9 @@ export class HomePage implements OnInit { async ngOnInit() { await this.getUser(); + if(this.user && !this.user.profile_mandatory_fields.length){ + this.getSessions(); + } this.isMentor = this.profileService.isMentor App.addListener('appStateChange', (state: AppState) => { this.localStorage.getLocalData(localKeys.USER_DETAILS).then(data => { @@ -98,10 +101,6 @@ export class HomePage implements OnInit { } async ionViewWillEnter() { - this.user = await this.localStorage.getLocalData(localKeys.USER_DETAILS); - if(this.user && !this.user.profile_mandatory_fields.length){ - this.getSessions(); - } this.gotToTop(); let isRoleRequested = await this.localStorage.getLocalData(localKeys.IS_ROLE_REQUESTED) let isBecomeMentorTileClosed =await this.localStorage.getLocalData(localKeys.IS_BECOME_MENTOR_TILE_CLOSED) From ccb3b1501b854ed8b54bb414f5172c8caecc10eb Mon Sep 17 00:00:00 2001 From: Afnan C <98315899+Cafnanc@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:22:23 +0530 Subject: [PATCH 2/2] Update http.service.ts --- src/app/core/services/http/http.service.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/core/services/http/http.service.ts b/src/app/core/services/http/http.service.ts index 925002d98..391dfdaa9 100644 --- a/src/app/core/services/http/http.service.ts +++ b/src/app/core/services/http/http.service.ts @@ -268,8 +268,14 @@ export class HttpService { await alert.present(); let data = await alert.onDidDismiss(); if (data.role == 'cancel') { - let auth = this.injector.get(AuthService); - auth.logoutAccount(true); + if(environment.isAuthBypassed) { + let auth = this.injector.get(AuthService); + auth.clearLocalData(); + location.href = environment.unauthorizedRedirectUrl + } else { + let auth = this.injector.get(AuthService); + auth.logoutAccount(true); + } } return false; } else {