Redirect to login after password reset.

Closes #11376
This commit is contained in:
Mike Jolley 2016-07-27 12:47:41 +01:00
parent 66c61eebc8
commit d2adabaf89
3 changed files with 7 additions and 7 deletions

View File

@ -987,7 +987,7 @@ class WC_Form_Handler {
do_action( 'woocommerce_customer_reset_password', $user );
wp_redirect( add_query_arg( 'reset', 'true', remove_query_arg( array( 'key', 'login', 'reset-link-sent' ) ) ) );
wp_redirect( add_query_arg( 'password-reset', 'true', wc_get_page_permalink( 'myaccount' ) ) );
exit;
}
}

View File

@ -41,6 +41,11 @@ class WC_Shortcode_My_Account {
wc_add_notice( $message );
}
// After password reset, add confirmation message.
if ( ! empty( $_GET['password-reset'] ) ) {
wc_add_notice( __( 'Your password has been reset successfully.', 'woocommerce' ) );
}
if ( isset( $wp->query_vars['lost-password'] ) ) {
self::lost_password();
} else {
@ -188,12 +193,6 @@ class WC_Shortcode_My_Account {
if ( ! empty( $_GET['reset-link-sent'] ) ) {
return wc_get_template( 'myaccount/lost-password-confirmation.php' );
/**
* After reset, show confirmation message.
*/
} elseif ( ! empty( $_GET['reset'] ) ) {
wc_add_notice( __( 'Your password has been reset.', 'woocommerce' ) . ' <a class="button" href="' . esc_url( wc_get_page_permalink( 'myaccount' ) ) . '">' . __( 'Log in', 'woocommerce' ) . '</a>' );
/**
* Process reset key / login from email confirmation link
*/

View File

@ -162,6 +162,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Respect stock status and prevent the "out of stock threshold" setting affecting existing in-stock products.
* Added Nigerian Provinces to i18n/state.
* Improved handling of shop page rewrite rules to allow subpages.
* Redirect to login after password reset.
[See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce/master/CHANGELOG.txt).