Hi,
I am working on a project where the back end is MVC 4
asp.net, the page has some content only visible when the request has been authenticated like so:
<div ng-app='test'>
<@if (Request.IsAuthenticated)
{
<div class="menu">
<div ng-view>
</div>
</div>
}else
{
@Html.Partial("The authentication page") --> Here the user should Login
}
</div>
The first time, the user sees the login page since the request is not Authenticated, then after that the page refreshes and he can see the menus, etc.
I have a problem when a server timeout occurs, If the user let's say is inactive for longer of the timeout period, and then request page XYZ, the request is no longer authenticated while I am making the Ajax call and geting the new page,
the server redirects to the login page with the following URL "/?ReturnUrl=XYZ", with status code 302.
The problem is that the login page gets inserted inside the <div> where ng-view is, thus showing the menu, etc. the expected behaviour is that I should be redirected to the Login Page(full page reload),
I have search in google and here, but it seems that is a problem with my implementation or i am not searching good enough...
Does any one have a clue of why this happens or how can i solve this problem?
regards,
Oscar