diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index df46f551b6240..7d8cc89bd74a6 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -987,7 +987,7 @@ public static function process_reset_password() { 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; } } diff --git a/includes/shortcodes/class-wc-shortcode-my-account.php b/includes/shortcodes/class-wc-shortcode-my-account.php index 38c0beefbf71b..39033c0c59792 100644 --- a/includes/shortcodes/class-wc-shortcode-my-account.php +++ b/includes/shortcodes/class-wc-shortcode-my-account.php @@ -41,6 +41,11 @@ public static function output( $atts ) { 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 @@ public static function lost_password() { 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' ) . ' ' . __( 'Log in', 'woocommerce' ) . '' ); - /** * Process reset key / login from email confirmation link */ diff --git a/readme.txt b/readme.txt index f444d00d4db4a..992ba0f52b282 100644 --- a/readme.txt +++ b/readme.txt @@ -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).