Closed mkv27 closed 10 years ago
This is incidental. It's caused by the profile object declared in AccountCtrl. When the login session is terminated, the object cannot access the profile data any longer.
This could be prevented by wrapping the logout function and tracking all active connections to secured data, then calling $off on each before calling logout. I'm not really interested in adding that to the seed as this is more of an implementation-specific and opinionated approach.
Thanks for clarification. I only have a little doubt, why if I $destroy the object in AccountCtrl whenever the scope is destroyed the warning no longer appears?
$scope.$on("$destroy", function() {
profile.$destroy();
});
I really appreciate your help : ]
That works in this case because we redirect to the login screen when the logout button is clicked (without waiting for the auth to be canceled). It won't work in all cases, but would work here.
Hi I see a warning on logout from account section. The warning is only displayed when the ngShowAuth or ngHideAuth directives is used, for example in partial home.html.
If this section does not charge the warning never displayed. Otherwise if I login, then go to home section, then go account and logout. The warning is displayed.
I think the problem is related to the "watch" method in the "simpleLogin" factory.
Warning:
Related "app/js/directives.js":