The second input argument $request
, in your app_login_redirect()
callback function, takes it’s value from source:
isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
so if I understand you correctly, you could just check if it’s empty or not, if you need to know that within your logic parts.