Closed odinseyeanalytics closed 7 years ago
Hi @odinseyeanalytics ,
I would defer the angular best-practices to the angular community, rather than to this github repo. I'd like to discuss bugs/feature requests here. Best-practices are definitely important, but not the point of this particular project.
Also, I wrote the code more than a year ago, when angular2 was still in beta, so many things changed since then :)
Regards, Vladimir Budilov
use always angular guards. use the connection file to code your guards depending on the responses you get from cognito. Make your solution agnostic, so if you have to change the authentication, you could. That way you will have a more solid code. I did it that way, I didn't use this quickstart template.
I have been looking for an efficient way to implement Angular 2/4 authorization/authentication models. This looks like a fantastic starting point - especially managing the initial login/registration steps.
However, I have a question about a design decision which differs from the angular.io demonstration model. That model shows that the authorization/validation step for pages should be built into the routes using route guards like canActivate() and canLoad() (see: https://angular.io/guide/router#milestone-5-route-guards) rather than per-component callbacks. Is there a benefit to this model with callbacks? Is building that content into the router module a recent Angular addition?