witoldsz / angular-http-auth

MIT License
2.38k stars 418 forks source link

Prevent double event #130

Closed DaAwesomeP closed 8 years ago

DaAwesomeP commented 8 years ago

The module is working perfectly for me except for one part. The auth interceptor is properly triggered when switching between pages. However, some pages make two or three requests, causes two or three login modals to pop up in succession after each other.

I have already fixed this in my own code by simply making a var called loggingIn that when true will prevent more modals from appearing when there is already on open, but I think that something should be built into the module.

All that is needed is a check not to send out more auth-loginRequired events until auth-loginConfirmed is triggered. However, the requests will still need to function as they do now and be rerun when the confirm event is sent.

dnauck commented 8 years ago

See also #95 and #120