Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password reset - conflict between Woocommerce & Lifterlms #2776

Open
4 tasks
saracomin96 opened this issue Oct 18, 2024 · 2 comments
Open
4 tasks

Password reset - conflict between Woocommerce & Lifterlms #2776

saracomin96 opened this issue Oct 18, 2024 · 2 comments
Assignees

Comments

@saracomin96
Copy link

saracomin96 commented Oct 18, 2024

Reproduction Steps

Use Woocommerce to reset user passwords

  1. Go to /my-account/lost-password and request a reset
  2. Click the link that arrives by email

Expected Behavior

The result when I land on the page should be the form that allows me to change the password

Actual Behavior

The form for requesting a password reset.

I noticed something when checking the code of both woocommerce and lifterlms

After clicking the link on the page, the added parameter, in url, is ?reset-pass=1 which seems to be generated by this function:

public function reset_password_link_redirect() {

		if ( is_llms_account_page() && isset( $_GET['key'] ) && isset( $_GET['login'] ) ) {

			$user = get_user_by( 'login', wp_unslash( llms_filter_input_sanitize_string( INPUT_GET, 'login' ) ) );
			$uid = $user ? $user->ID : 0;
			$val = sprintf( '%1$d:%2$s', $uid, wp_unslash( llms_filter_input_sanitize_string( INPUT_GET, 'key' ) ) );

			( new LLMS_Cache_Helper() )->maybe_no_cache();
			llms_set_password_reset_cookie( $val );
			llms_redirect_and_exit( add_query_arg( 'reset-pass', 1, wp_lostpassword_url() ) );
		}
	}

This parameter does not allow you to view the password reset form, but the reset request form is displayed again.

Indeed, Woocommerce checks that the URL contains the ?show-reset-form=true parameter to display the password reset form.

This issue has be recreated:

  • Locally
  • On a staging site
  • On a production website
  • With only LifterLMS and a default theme
@ideadude ideadude moved this to Awaiting Triage in Development Oct 18, 2024
@ideadude ideadude self-assigned this Oct 18, 2024
@jurasjo
Copy link

jurasjo commented Oct 18, 2024

If I remember correctly, I had this problem. The solution was to unset Dashboard page from Settings/Accounts in LifterLMS. Then WC take care of proper password reset.

It might be connected to this issue #2741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting Triage
Development

No branches or pull requests

5 participants
@jurasjo @ideadude @saracomin96 and others