how can mvc return Unauthorized code without redirecting to LogIn view
问题 My MVC web application serves two types of users. First one over standard web browser; Second one over REST returning only JSON data. Additionally, Both require Authentication and authorization; Both scenarios are differentiated based on the route so that I know what content to serve. When users access the application, if they are not logged in, the application should react differently. In the first case it should return the default LogIn page (this is fine). In the second case it should