witoldsz / angular-http-auth

MIT License
2.38k stars 417 forks source link

Prevent unbuffered responses from being deferred. #18

Closed sparks closed 11 years ago

sparks commented 11 years ago

401 responses matching the shouldIgnoreURL criteria will not be buffered and as such they should be be returned as a deferred promise but rather they should be rejected.

By rejecting instead of deferring we allow the client to properly detect failed login attempts in the login form. e.g. 401 from /api/auth properly returns a 401 immediately upon improper credentials.

mbrio commented 11 years ago

A fix for this is awaiting application in this pull: https://github.com/witoldsz/angular-http-auth/pull/13

sparks commented 11 years ago

Yes I saw your pull request, looks very interesting. However you're offering new features, this is purely a bug fix which could potentially be applied while your new features are being discussed/developed. Obviously this would become irrelevant once your changes are merged.

witoldsz commented 11 years ago

Thanks, fixed. Cannot merge, because the implementation is now different.

sparks commented 11 years ago

Great thanks