-1

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

1
  • Call a function on menu click. check if user is logged in. If not then redirect to login. Jul 27, 2016 at 10:43

1 Answer 1

0

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').

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.