I have the normal workflow of an app with login: First page is the login screen and you get to the tabs page after login. Now I’m trying to implement a logout button. But if I use
this.navCtrl.setRoot(Login);
the tabbar is still displayed.
I also tried to use
I think you are going about this backwards. It feels much more natural to me to do this reactively instead of declaratively, by having an observable in a service somewhere that tracks the authentication state of the user. To log out, inject that service and call its logout function. In the application component or some root page, also inject the same service, subscribe to it, and change root pages there.
I really like the kind of approach you are suggesting @rapropos, about having some service handling changes in the root page, but I’m pretty new to the Ionic framework and really don’t have much clue about doing what you proppose in your answer.
Could you give me some advice or point me to some documentation where this is explained in more detail?