This happens automatically. But I noticed you had default-target-url, which to me says after logging in send them to that page. If you remove it it should redirect them back to the page they tried to view, unless they enter invalid login stuff. which takes them to the general/home page
I would recheck the attributes to make sure they mean what you expect them to mean. I think you possibly just copied and pasted this from somewhere else expecting it to work correctly without understanding what it all meant.