ng-token-auth icon indicating copy to clipboard operation
ng-token-auth copied to clipboard

Checking events error

Open razvandk opened this issue 10 years ago • 2 comments

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.

razvandk avatar Nov 17 '15 08:11 razvandk

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!

fabiancarlos avatar Nov 25 '15 01:11 fabiancarlos

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.

fabiancarlos avatar Nov 25 '15 01:11 fabiancarlos