witoldsz / angular-http-auth

MIT License
2.38k stars 417 forks source link

Added 403 support #32

Closed tonyeung closed 10 years ago

tonyeung commented 11 years ago

added 6 lines

cboden commented 11 years ago

:+1:

mattbodman commented 11 years ago

Yes please.

metalik commented 11 years ago

+1

dehru commented 11 years ago

Yes. The rest service we use returns a 403 instead of a 401. I filled a bug against it, but this would give us a work around until it's fixed.

xmlking commented 10 years ago

403 interception can be useful to display a notification e.g, " you don't have permeations to access this functionally" with out this capability developer has to manually handle those scenarios. In my case we have to show the request failed due to authentication required or due to resource forbidden.

witoldsz commented 10 years ago

Guys, I don't see the reason why the HTTP 401 interceptor should now handle additionally 403 responses doing nothing but broadcasting some message...

Why won't you add one more HTTP interceptor which broadcasts message on 403 arrival? The associated commit (31ba09911a8e0c16ad534e55af30c786d7f3bda4) does not seem to interact with anything but $scope.$broadcast. It also adds noAccessConfirmed() method to authService - again, doing nothing but broadcasting some custom message.

If you have some issues with your back-end, fix it elsewhere. There is no just one "slot" for HTTP interceptor. You can add as many as you want in any order you desire.