googlearchive / angularfire-seed

Seed project for AngularFire apps
http://angularfire.com
MIT License
409 stars 191 forks source link

$firebaseSimpleLogin:logout event not triggered #28

Closed wulymammoth closed 10 years ago

wulymammoth commented 10 years ago

I attempted to use the routeSecurity module, but tweaked it to work with ui.router here: https://github.com/sudostack/iggy/blob/master/app/components/firebase/uiRouteSecurity.js

Each time I log into my the application, I'm logging some message to console when listening on $rootScope for the $firebaseSimpleLogin:login event.

$rootScope.$on('$firebaseSimpleLogin:login', function(evt, user) {
  console.log('login event fired');
  $rootScope.auth.user = user;
});

However, I'm doing the same thing for log out

$rootScope.$on('$firebaseSimpleLogin:logout', function(evt, user) {
  console.log('log out event fired');
  $rootScope.auth.user = null;
});

When I check auth for a user, the value is null, meaning I've logged out, however, the logout event was not triggered. This is problematic because I have a callback that needs to be invoked upon the trigger of this event.

The place where I'm listening for these events is in my login controller - https://github.com/sudostack/iggy/blob/master/app/regislogin/regislogin.module.js