"Redirect on login" option for referrer link

Can the "Redirect on login" option redirect back to the page they came from?

We can select the "Site URL" option and direct them to a specific page but I need visitors to be directed to the page they came from. I populate the login page link with the redirect_to value of the page they came from. Here is an example:


Is there a variable I can add to the link field like the examples you display user_id? Or, can I hook into a plugin action and sent it my url string:
$login_redirect_link = get_site_url() . '/login/?redirect_to=' . esc_url( get_permalink() );