Bad hash after password update
-
Version: 3.9.6
Issue description:
I’m running into a redirect loop after changing a member password. It appears that the cookies are not cleared properly, and the bad hash used for user validation is not being removed nor handled correctly.Reproduce:
1. Log in
2. Change the password
3. Navigate to any page (e.g. homepage) without (re-)logging in
4. Redirect loopI’ve fixed this by changing the validate function in simple-membership/classes/class.swpm-auth.php:320->validate().
Added code:
$logout_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '?swpm-logout=true'; wp_redirect($logout_url);
Before:
wp_logout(); //Force logout of WP user session to clear the bad has
Login log:
[04/02/2020 9:40 AM] – SUCCESS: Authentication request using email address: [email protected], Found a user record with username: Testlid
[04/02/2020 9:40 AM] – SUCCESS: Authentication request – Username: Testlid
[04/02/2020 9:40 AM] – SUCCESS: Authentication successful for username: Testlid. Executing swpm_login action hook.
[04/02/2020 9:40 AM] – SUCCESS: Trying wp_signon() with username: Testlid
[04/02/2020 9:40 AM] – SUCCESS: wp_authenticate action. User with username: Testlid is already logged in.
[04/02/2020 9:40 AM] – SUCCESS: wp_login hook triggered. Username: Testlid
[04/02/2020 9:40 AM] – SUCCESS: Setting current WP user to: Testlid
[04/02/2020 9:40 AM] – SUCCESS: Triggering swpm_after_login hook.
[04/02/2020 9:40 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:40 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:41 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Bad Hash
[04/02/2020 9:42 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Bad Hash
[04/02/2020 9:42 AM] – SUCCESS: validate() – Username: Testlid
[04/02/2020 9:42 AM] – SUCCESS: validate() – Bad Hash
- The topic ‘Bad hash after password update’ is closed to new replies.