Disable the tabs on logout

I am creating a ionic app with the tabs template.

Now initially i am using a login page and successful signing in you are redirected to the tabs page that controls all the other pages that appears in the tabs.

Now there is a logout page in the tabs section and when i click i should be able to logout from the session and goes to the initial login page where there is no tabs but just the login page. and on successful login i should see the tabs and all.

Right now if i log out and goes to the login page as below;


i am going to the login page but the tabs are shown as usual, and i could goes to the other pages by using tabs, which is not the intended behavour of my app, but should be shown only on successful login.

My question is how do i disable the tabs on logout and shows it again after i logged in, and achieve authentication?


i am going to the tabs page from the login page

You need to listen for the user status on your login page, and only show the tabs if a user is logged in. The standard ways to listen are with BehaviorSubject/ReplaySubject or Ionic Events. You can hide the tabs with ngIf.

I am showing the tabs only when the user credentials are met. How can i hide the tabs with ngIf?

*ngIf=“isLoggedIn” where isLoggedIn is a boolean.