Is there a good example of using deep linking with ‘guards’ for logged in vs anon users? I’m having trouble piecing all of this together.
Here are the requirements I’m trying to implement:
- Anonymous (non-logged in) should be directed to login page by default.
- Logged in user will get many pages (data bound list in the side menu).
- I want to allow deep links such as /customers/123. However if the user is not logged in, I need to redirect user to a login prompt with a return url (or nav params) to route them back to the original destination.
- When user visits root (e.g. root of the site in browser, or when opening the mobile app), I want to change their default rootPage based on their logged in status… If they’re not already logged in, it should redirect to the login page. If already logged in, I’d like to load a (secured) page of their recent activity.
I’m deploying my app both a mobile app and the ‘browser’ platform as a web app (with some reduced functionality), hence the deep linking is an important feature.
Any examples or further documentation for how to wire up these features?