After login: Redirect to the page before login form

Apparently, this is not the thing you want to use D:
I looked at the code for this and it’s not as I expected D:

It takes the queryParam as opposed to getting the referer or something similar.