witoldsz / angular-http-auth

MIT License
2.38k stars 417 forks source link

Interceptor retrying incorrect login requests #8

Closed villelahdenvuo closed 11 years ago

villelahdenvuo commented 11 years ago

From what I gather:

  1. Try to log in with incorrect credentials
  2. Login in with correct credentials
  3. Login form slides back open, because wrong credentials are tried again

So a simple fix would change failed login from 401 to something else, but that does seem like the best options for incorrect credentials. Any ideas how to mitigate this behaviour gracefully or just change error code for login requests?

A6PAMOB commented 11 years ago

Hello Please find in angular-http-auth.js the string: authServiceProvider.pushToBuffer(response.config, deferred); an replase it : if (response.config.url != 'api/login') authServiceProvider.pushToBuffer(response.config, deferred); where 'api/login' is the url of the auth service

witoldsz commented 11 years ago

The problem was discussed also in other issues. I think I will add an option for authentication provider to be aware of URLs which it should ignore. Will reference and close all the issues once it is ready.