Ionic sidemenu login

Issue

I am developing an ionic app with firebase login .It has a sidemenu with pages when they click the sidemenu link , i want the user to be redirected automatically to login page if they are not logged in .

Any help would be greatly appreciated

Solution

If you are using ionic 1. Write a function in your controller which would check the state of your user. i.e Whether logged in or not and call the function whenever the user clicks on the side links. If logged in then you can do a $state.go(‘stateName of the link’) else you can do a $state.go(‘your login state name’).

Answered By – Bala Abhinav

Leave a Comment