Membership 2 Pro – redirect user after registration to original protected content

If an existing member gets to the protected site, a protected content page is being displayed and after login member is redirected back to original content. But if that visitor is not a user/member yet and registers for a user account/membership (following the register link on the Protected Content page), such a user ends up on “Account” page after the registration instead of being redirected back to original page.

The “redirect add-on” won’t help here because it can only redirect to a predefined URL while here we want the newly registered user to be redirected back to the original “members only” content after registration.

Is there any code snippet or other solution to achieve that?