I'm using angular to get states and setup application routes and manage access to certain pages, however as the states are loaded in the application config parts, any user can see my URI and my states even before authentication. What am looking for is a solution to load only the first login page and then if user is authenticated the application can ask the server for the rest of authorized states and URI.
Asked
Active
Viewed 38 times
-2
-
Can you provide your code? – Akashii Apr 11 '17 at 15:34
-
numerous ways to approach this and lots written on the web about it – charlietfl Apr 11 '17 at 15:44
-
@charlietfl would you give an example? I was looking and I just got those that manage the authorization and access after authentication – Med Apr 11 '17 at 16:01
-
@Med could you provide pulknr for what you have tired – Krsna Kishore Apr 11 '17 at 16:42
1 Answers
0
Make a separate app for login, and once the user is authenticated (from back end), redirect the user to your main app from the success callback of the authentication rest call. For sharing data(logged in user data) between these apps you can use session storage.

Sachet Gupta
- 822
- 5
- 18