If a membership user try to get access to a specific folder and it is now allowed by roles, the system is redirected to /Account/Index and asks for login and password again.
I would like to change that behavior since the user is already logged in and I just want to redirect to another /controller/action.
Could I get some help from here?
Thanks in advance.
I do something similar in all of my web applications. If a user has authenticated, but does not meet the security requirements to view the page I throw an HTTP 403 exception and then display a specific view for the 403 exceptions.
This is the snippet from my custom authorize attribute:
And here is the snippet from my Global.asax where I actually perform the view response (this assumes an
ErrorControllerexists and then a view calledError403: