Skip to content

Commit

Permalink
Merge pull request #518 from aranaravi/develop
Browse files Browse the repository at this point in the history
[MOSIP-27977]Handled browser back button messages in uinservice dashboard
  • Loading branch information
aranaravi authored Oct 12, 2023
2 parents 3701488 + 2d10269 commit 7fc192b
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,21 @@ export class DashboardComponent implements OnInit, OnDestroy {
@HostListener('window:popstate', ['$event'])
PopState(event) {
if (window.location.hash.includes("uinservices")) {
console.log("Testing2")
} else {
console.log("Testing3")
if (confirm("Are you sure want to leave the page. you will be logged out automatically if you press OK?")) {
this.auditService.audit('RP-002', 'Logout', 'RP-Logout', 'Logout', 'User clicks on "logout" button after logging in to UIN services');
this.logoutService.logout();
} else {
history.pushState(null, null, window.location.href);
//this.router.navigate([this.router.url]);
return false;
if(window.location.hash.split("#")[1] === "/uinservices/dashboard"){
this.showRedirectPopup();
}
} else {
this.showRedirectPopup();
}
}

showRedirectPopup(){
if (confirm("Are you sure want to leave the page. you will be logged out automatically if you press OK?")) {
this.auditService.audit('RP-002', 'Logout', 'RP-Logout', 'Logout', 'User clicks on "logout" button after logging in to UIN services');
this.logoutService.logout();
} else {
history.pushState(null, null, window.location.href);
return false;
}
}

Expand Down

0 comments on commit 7fc192b

Please sign in to comment.