I got a beautiful login system which writes the id, level, name picture of the user, who’s logged in, to the localStorage. But my app now opens standard on page ‘/pendingrequests’, this is perfect for a manager (level 2), a user (level 1) should open the page in ‘/calendar’… Is there a way to check which level is logged on and depending on that level open the app on that page?
I know after logging in it can be done by location.path, but when I open the app again, and a USER is still logged in, the app again opens in /pendingrequests
btw: ‘localStorage.level’ keeps the level stored of the user who’s logged in.
Can anyone help me by setting up the function to check if level is 1 or 2 and set the $urlRouterProvider depending on this value?