简体   繁体   中英

Woo Lost Password form redirects to wp-admin reauth=1

In WooCommerce, on https://shop.example.com/my-account/lost-password/ when I submit a valid user e-mail, I get redirected to the wp-login form.

Specifically with 302 to https://shop.example.com/wp-admin/ , which then redirects me 302 to https://shop.example.com/wp-login.php?redirect_to=https%3A%2F%2Fshop.example.com%2Fwp-admin%2F&reauth=1 (I watch it in devtools network tab).

Entering a wrong e-mail works and gives error message.

I've tested that the nonce gets validated in class-wc-form-handler.php .

Any ideas of reasons for this?

My WooCommerce is running on a subdomain, using Multidomain plugin.

Thanks!

WooCommerce redirects using wp_safe_redirect , which checks for allowed_redirect_hosts . These can be added as in this blogpost :

add_filter( 'allowed_redirect_hosts', 'misha_extend_allowed_domains_list' );
 
function misha_extend_allowed_domains_list( $hosts ){
 
    $hosts[] = 'example.com';
    $hosts[] = 'shop.example.com';
 
    return $hosts;
 
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM