Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Problem with reauth parameter #8

Open
Nirzol opened this issue Dec 11, 2018 · 0 comments
Open

Problem with reauth parameter #8

Nirzol opened this issue Dec 11, 2018 · 0 comments

Comments

@Nirzol
Copy link

Nirzol commented Dec 11, 2018

Hello

Problem when access wp-admin directly . WP redirect to wp-login.php with REAUTH=1 parameter.
This parameter kill all cookies...
I already get this prob with my CAS plugin and resolved it with filter.

To solve this , I add a filter into construct to remove this parameter
add_filter( 'login_url', array( $this, 'efg_wp_cas_clear_reauth' ) );

And my function :
/**
* Clear reauth parameter from login url to login directly from CAS server.
* Remove the reauth=1 parameter from the login URL, if applicable. This allows
* us to transparently bypass the mucking about with cookies that happens in
* wp-login.php immediately after wp_signon when a user e.g. navigates directly
* to wp-admin.
*/
public function efg_wp_cas_clear_reauth( $login_url ) {

    $login_url = remove_query_arg( 'reauth', $login_url );
    return $login_url;
}

Hope will help people using this plugin.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant