I have implemented an AngularJS application that utilizes angular ui-router for routing.
Despite my efforts to enhance security, I encountered some challenges:
To manage user authentication, I store tokens and user roles in local storage, redirecting users based on their roles. However, the watch service I implemented on local storage does not retain the previous value upon refresh, causing my checks to fail.
If a user changes the token in local storage and then refreshes the site, I am unable to detect this change.
In such cases, unauthorized users can access templates but are unable to fetch data due to backend security measures. It is crucial to restrict access to templates as well.
I am seeking assistance in enhancing client-side security in Angular to address these issues.