Skip to content

Commit

Permalink
Redirect to login after password reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Jul 27, 2016
1 parent 66c61ee commit d2adaba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion includes/class-wc-form-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
11 changes: 5 additions & 6 deletions includes/shortcodes/class-wc-shortcode-my-account.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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' ) . ' <a class="button" href="' . esc_url( wc_get_page_permalink( 'myaccount' ) ) . '">' . __( 'Log in', 'woocommerce' ) . '</a>' );

/**
* Process reset key / login from email confirmation link
*/
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down

0 comments on commit d2adaba

Please sign in to comment.