I am new to angular2/ionic. What I'd like to do is only allow access to pages if they are authenticated. There will be some pages that don't require auth, but 95% need to be authenticated. I was hoping there was like a beforeNavigate
property on the @Page
decorator where I could run logic that would push the login page onto the nav stack if they weren't authenticated. Looking around, I can't seem to find anything like that. What would be the proper way of doing this without having to stick it in every constructor or something? Is there another way I could approach this? TIA.
Please note this is Angular2 / Ionic2 and typescript if that matters any.