In the user-list.component.js, I do the following, is there a way to inject this in any page that I don't want to be accessible when no user is logged in?
this.currentUser = Auth.getCurrentUser();
if (!this.currentUser) {
$window.location.href = '#!/logout';
}
You could extract it out into your auth service. It might seem weird because it's manipulating your UI, but I don't know if theres a better place for shared controller code
In the
user-list.component.js
, I do the following, is there a way to inject this in any page that I don't want to be accessible when no user is logged in?