auth0-blog / angular2-authentication-sample

This is a sample that shows how to add authentication to an Angular 2 (ng2) app
MIT License
966 stars 334 forks source link

Angular2 Component not initializing after login #66

Open IAMtheIAM opened 8 years ago

IAMtheIAM commented 8 years ago

I copied the files from this repo and use LoggedInOutlet.ts to setup authentication in my angular2 app, which is based on the Angular2 Webpack Starter repo.

Protected routes and login works perfectly, but the problem is that after login, the component does not initialize itself. It just loads the component but all the the Angular2 stuff like {{ somevar }} don't load, UNTIL I click on a form or click the component navigation route again. Then it initializing.

What could be causing the components to fail to load after login?

Here is my app: http://starterhome.azurewebsites.net

chenkie commented 8 years ago

I just updated to rc3 and have gotten rid of the LoggedInOutlet in favor of an AuthGuard. Check it out and let me know if it helps :)