Authentication in MVC is controlled by the [Authorize] attribute. If this attribute is put in front of a controller action, the unauthenticated user will be redirected to the login form. Usually, the URL will be something like http://App/Login?ReturnUrl=/App/Page. After authentication, the user will be redirected back to the /App/Page Url.
If you are writing custom FormsAuthentication, this does not work. Usually, the user will be redirected to the default redirect page as specified in the web.config. Here is a forum post describing this situation: http://stackoverflow.com/questions/4246606/formsauthentication-getredirecturl-always-returns-the-default
As described in the post, a hidden form element can do the trick. But, it does not work, when the user retries a login (after wrong password). To make it work, ensure that ReturnUrl is present in the ViewData and passed along multiple invalid attempts:
<% if (ViewData["ReturnUrl"] != null)
{ %>
<%= Html.Hidden("ReturnUrl", ViewData["ReturnUrl"].ToString() )%>
<% } %>