ng-token-auth
ng-token-auth copied to clipboard
Checking events error
I am using your code in order to catch the login succes, but im getting multiple alerts (Sometimes its 2,3 even 4). It looks like it is checking multiple times if the user has logged in successfully. This is what im using.
$rootScope.$on('auth:login-success', function(ev, user) {
alert('Welcome ', user.email);
});
Do you have any idea what it might create this error?
Thanks in advance.
I'm having the same problem, and i read somewhere that better use $scope and not $rootScope for emit and receive the broadcast, but this is in the source code unfortunately!
You can add $rootScope = "" inside the function to force that not happen in the meantime. That will give you a alert on console, but not much destructive.