Howdy!
I am using WordPress CAS Client plugin to redirect logins from wp-admin to the cas server and then back to the site. The current configuration sends the user to the admin side of the sight. It does this with the wp_redirect function:
wp_redirect( site_url( '/wp-admin/' ));
I'm trying to think of how I can redirect the user to the page they clicked the log in button from. I've tried using $_SERVER['HTTP_REFERER'] but it only sends to the last visited page (wp-admin). Any links or tips would be appreciated!