How to do "restricted page/asset"->login->register->"restricted page/asset"?
You should be able to get the return url from craft. I just did a quick test and it seemed to carry over to a registration page from a log in page that happened due to a restricted page, so maybe try something like this in your registration template:

{% set redirectUrl = (craft.session.getReturnUrl() ?: '/') %}

&lt;input type="hidden" name="redirect" value="{{ redirectUrl }}"&gt;


That way after they register they will be redirected to the restricted page, asked to log in and then craft should redirect them to the restricted page automatically.

Hope that helps!