Tabs persisting when logging out of my app - please help :)


#1

I have an ionic app which has tabs and authentication, the auth works perfectly but when logging out the tabs still display. Here is my login method:

this.authProvider.loginUser(email, password).then(
authData => {
this.loading.dismiss().then(() => {
this.navCtrl.setRoot(TabsPage);
});
And here is my logout method:

logOut(): void {
this.authProvider.logoutUser().then(() => {
this.navCtrl.setRoot(‘LoginPage’);
});
}
Any help appreciated


#2

Why use ‘ in passing LoginPage to navctrl, but not when logging in?


#3

So basically your tabs are appearing on login page after log out from tabs page right?

if that so then try this out,

use this line
this.app.getRootNav().setRoot('LoginPage');

instead of
this.navCtrl.setRoot(‘LoginPage’);

but don’t forget to import and inject the App

import { App } from 'ionic-angular';
constructor( public app: App ) {}