Patch to fix "Redirect to"
-
Hi,
I’m using your plugin to connect user via LinkedIn. I’m using the “popup” option for the login and notice that I lost all query params in my URL and I’m automatically redirect to the URL specify in the settings which is annoying cause I can login on different pages but lost where I was after redirect.
I’ve inspected the code for the redirection and notice some irregularities. I’ve made a patch to fix it, free to you to use it/modified it. It apply on the “2.1.5” version of your plugin.
Thanks!
diff --git a/includes/services/wsl.authentication.php b/includes/services/wsl.authentication.php index 51d3d95..5e9804f 100644 --- a/includes/services/wsl.authentication.php +++ b/includes/services/wsl.authentication.php @@ -510,6 +510,8 @@ function wsl_process_login_reauth() function wsl_process_login_get_redirect_to() { + $redirect_to = ''; + if ( isset( $_REQUEST[ 'redirect_to' ] ) && $_REQUEST[ 'redirect_to' ] != '' ){ $redirect_to = $_REQUEST[ 'redirect_to' ]; @@ -527,10 +529,6 @@ function wsl_process_login_get_redirect_to() } } - if( get_option( 'wsl_settings_redirect_url' ) != site_url() ){ - $redirect_to = get_option( 'wsl_settings_redirect_url' ); - } - if( empty( $redirect_to ) ){ $redirect_to = get_option( 'wsl_settings_redirect_url' ); }
https://www.ads-software.com/plugins/wordpress-social-login/
- The topic ‘Patch to fix "Redirect to"’ is closed to new replies.