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:

  1. i have route handles page access: enter image description here

  2. this route asp.net mvc page returns viewresult - view - angularjs: enter image description here

  3. the view action has attribute verify authentication of user and, if user doesn't have permissions, i'll return 403 json response instead view: enter image description here

  4. i created interceptor handles response error - in case response throw 403 error -, can redirect user login page instead: enter image description here

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): enter image description here

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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -