colthreepv / colthreepv/angular-login-example
Can I store the userRole in the localStorage?
- Dominant language
- JavaScript
- Stars
- 517
- Forks
- 166
- PR merge metrics
- No merged PRs in 30d
Description
First, thank you for your example! I learned a lot from it :)
Now, I have a question, can I store the userRole in the localStorage?
In this example, when the user requested a $state, the loginService will do the getLoginData() function, if there is a token in the localStorage, the loginService will not init the userRole ,so the pendingStateChange will be inited. Which cause the the grandfather do the resolve to retrieve the userRole remotely.
So if I init the userRole to be public and store it in the localStorage, when user do some login action, I change the value of userRole in the localStorage. By this way, can I delete the resolve in the grandfather?Will it be unsafe if I delete the resolve?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.