diff --git a/shibboleth.php b/shibboleth.php index 4c4ca3d..499ee21 100644 --- a/shibboleth.php +++ b/shibboleth.php @@ -861,7 +861,12 @@ function shibboleth_custom_password_reset_url( $url ) { * @since 1.0 */ function shibboleth_login_form() { - $login_url = add_query_arg( 'action', 'shibboleth' ); + global $wp; + $url = false; + if ( isset( $wp->request ) ) { + $url = wp_login_url( home_url( $wp->request ) ); + } + $login_url = add_query_arg( 'action', 'shibboleth', $url ); $login_url = remove_query_arg( 'reauth', $login_url ); $button_text = shibboleth_getoption( 'shibboleth_button_text', 'Log in with Shibboleth' ); $disable = shibboleth_getoption( 'shibboleth_disable_local_auth', false );