Debug login from frontend#53
Conversation
|
I would like to get @jrchamp's thoughts on this before approving this PR. |
|
I've done some testing on a single site and it's definitely a better experience to have a working login link with an appropriate return_to. However, because global $wp;
$url = false;
if ( isset( $wp->request ) ) {
$url = wp_login_url( home_url( $wp->request ) );
}
$login_url = add_query_arg( 'action', 'shibboleth', $url );I'll take a look at the experience on multisite and follow up. EDIT: Working as expected. Not sure what else to test. |
jrchamp
left a comment
There was a problem hiding this comment.
Please change to this so that admin deeplinks with an auth redirect continue to work:
global $wp;
$url = false;
if ( isset( $wp->request ) ) {
$url = wp_login_url( home_url( $wp->request ) );
}
$login_url = add_query_arg( 'action', 'shibboleth', $url );|
Ok like this ? |
|
Yes, mostly. There shouldn't be any spaces used to indent, because WordPress uses tabs to indent. Sorry, I know my comment uses spaces because the github comment box doesn't make adding tabs easy. |
jrchamp
left a comment
There was a problem hiding this comment.
Thank you!
To summarize this change: Improve the Shibboleth login link so that when it shows up on a normal request it will correctly still be a login link and will redirect back to the page that showed the login link.
Prior to this change: Shibboleth login links created by this code when on any page other than wp-login.php do not work because they just append action=shibboleth to the request URL.
|
This looks good to me. Merging. |
Here is a general fix to take into account the situation where the login form is displayed outside the login page, for instance when a theme display a login form in a menu or as a widget.