I'm working on a Asp.Net MVC 5 project with its own Individual User Account template. I set roles for users. I authorized only specific roles for specific action methods. But the problem is, even when I'm logged in, with a role that doesn't have access permission to a specific action method (example the delete method), it navigates me to the login page. So I can login with an other user while I'm already logged in, and this doesn't make sense. Why does it handle authorization filters this way?!
So how to make it instead of navigating to the login page to give an custom error, to show an access denied view?
I'm trying to solve this from the answers from similar questions, but they don't get me anywhere!