The standard pages template for the identification page (themes/standard_pages/template/identification.tpl) does not use the $U_REDIRECT template variable if it is set so logging in through that page always redirects to the site's main page instead of the URL in the "?redirect=" query string which is being set by the identification.php file.
I added the following right after the opening <form> tag (line 43) and the page worked as expected.
{if isset($U_REDIRECT)}
<input type="hidden" name="redirect" value="{$U_REDIRECT|@urlencode}">
{/if}Offline