asp.net mvc - Prevent AngularJS route to load view if receives 403 error -
i'm creating permission back-end code that, whenever user tries access specific page, i'll check permissions and, if don't have permissions, return 403 error in json result.
the following show how proccess work:
i have route handles page access:
this route asp.net mvc page returns viewresult - view - angularjs:
the view action has attribute verify authentication of user and, if user doesn't have permissions, i'll return 403 json response instead view:
i created interceptor handles response error - in case response throw 403 error -, can redirect user login page instead:
the steps working fine , it's redirecting login when 403 error. however, i'm getting strange error on console (don't worry route name, it's correct):
it seems angularjs continues promise flow instead stop when intercept 403 error. there way prevent occur? mean, stop flow after 403 error , foward user route, same i'm doing now?
thank all!
Comments
Post a Comment