Sample app: unify Auth & Unauth angular JS apps #6
For the sample application, do you have any suggestions how I can use the same Angular SPA for authenticated users and non-authenticated users? Currently, the user is redirected to the login page if they are not logged in. I could have a separate angular app for unauthenticated users, but this will introduce redundancy because unauthenticated users share certain features - say for instance - the public/unauthenticated users should be able to see a list of questions and answers, but only authenticated users will be able to post questions and answers.
Any insight would be appreciated.
First of all, if your application will be public, you should also think about SEO if you're using Angular (Fortunately there are some solutions but you should take care of it).
Actually, it's simple. In the sample app (https://github.com/aspnetboilerplate/mo ... ter/sample), you should remove [AbpAuthorize] of the HomeController. Then MVC will not redirect to login.
In your angular application, you should check if user logged in and show some menus/links. You should only authorize needed app service methods, not all.