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

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

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

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 ) {}
3 Likes