michaelryanmcneill / shibboleth

Shibboleth plugin for WordPress
https://wordpress.org/plugins/shibboleth/
19 stars 11 forks source link

Shibboleth login form has wrong url when in frontend #52

Closed Alhrath closed 4 years ago

Alhrath commented 5 years ago

On some websites, the theme display a login form in the frontend. When it's the case, the shibboleth_login_form function will display an incorrect link to shibboleth login (actual_page_url?action=shibboleth) that will fail to redirect the user.

I fixed this by changing the first line of the function (line 864) to : global $wp; $login_url = add_query_arg( 'action', 'shibboleth', wp_login_url( home_url( $wp->request ) ) ); This way, the user will be redirected correctly to shibboleth auth page, then redirected back to the original page.

Is it possible to implement this feature in the next release ? I'm currently using last version (2.1.1).

michaelryanmcneill commented 5 years ago

If you could provide me a way to reproduce this, I'd really appreciate it. Also, please add your code into a PR and I'll review it.

Alhrath commented 5 years ago

Unfortunately, the situation I came across involve a paid theme, Jupiter, so I cannot provide a full reproducible method, but here is the code part that cause the problem :

`

This code is displayed in a submenu but you should be able to display it anywhere outside the login page for testing. I sent you a PR with my fix : #53

michaelryanmcneill commented 4 years ago

This is resolved by #53 which will be included with 2.2. Sorry for the delay.