Prevent back to login page when click back button after login ionic 4


Hi, i’am creating app with ionic 4 and when login and navigate to home page
if click back button the app return back to the login page is there anyway to make the app close instead of back to login page
or set root page to home after login like in ionic 3 “navCtrl.setRoot()”


Having the application ‘quit’ by use of the back button is not a recommended user experience pattern.

To prevent navigating to a page, look at Angular’s routeguards to manage your navigation flow.