Currently, I am in the process of developing a mobile hybrid app using Angular and Ionic.
One of the key features I am implementing is conditional login based on the user's role. When a user logs in, I capture their role and direct them to the corresponding role-based page. To achieve this, I store the role data in LocalStorage and retrieve it after login.
However, I am facing an issue with handling the conditional navigation for
$urlRouterProvider.otherwise('app/user');
.
For instance, if I log in as user2 and then close the app, upon reopening it, the page should reflect the specific user role, but it defaults to the $urlRouterProvider.otherwise
page.
I attempted to address this issue by following the guidance provided in this link, but unfortunately, it did not resolve my problem.