Closed wulymammoth closed 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
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.
However, I'm doing the same thing for log out
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