Ask your WordPress questions! Pay money and get answers fast! (more info)

Password reset does not reset password - but appears to WordPress

  • SOLVED

I having a terrible nightmare. This is worrying.

Everytime I reset a password (i've tested this on multiple users) it appears to work, but when you log it says...

ERROR: The password you entered for the username ... is incorrect. Lost your password?

But I have 100% tested over and over with definite correct passwords but still I can get a password to work. Every user that resets their password, is locked out forever.

I've de-activated every single plugin - but it still does the same..

How and why would this happen?

I am going to test my functions.php now to see if that is causing the problem.


<strong>UPDATE</strong>

Following the codex and adding this code...

[[LINK href="http://codex.wordpress.org/Plugin_API/Action_Reference/password_reset"]]http://codex.wordpress.org/Plugin_API/Action_Reference/password_reset[[/LINK]]

add_action( 'password_reset', 'my_password_reset', 10, 2 );
function my_password_reset( $user, $new_pass ) {
wp_redirect( home_url() );
exit;
}

This seems to break the functionality of my password reset on my wordpress.

The password appears to reset OK as redirect work - but not quite.

If I click on the reset password link in my email for a second time, the key is not invalid and works again :/ But still does not actually reset the password.

But If I removed the function it works ok.

Does this happen to anyone else?

Answers (7)

2013-11-12

Hariprasad Vijayan answers:

Hello,

Are you using custom function?


Josh Cranwell comments:

Nope removed all functions and plugins

I have discovered old password still works, the password reset does not actually reset the password as old still works and the new password does not.


Hariprasad Vijayan comments:

Which version of wordpress you are using? have you upgrade wordpress?


Josh Cranwell comments:

This is the problem...

// NEW PASSWORD RESET REDIRECT
function repsol_lost_password_reset_redirect() {
wp_redirect( home_url() );
exit;
}
add_action('password_reset', 'repsol_lost_password_reset_redirect');


I made this function in an older version of wordpress and now breaks the password reset.


Hariprasad Vijayan comments:

Try this
// NEW PASSWORD RESET REDIRECT

function repsol_lost_password_reset_redirect() {

wp_redirect( home_url() );

exit;

}

add_action('password_reset', 'repsol_lost_password_reset_redirect', 10, 2 );


Josh Cranwell comments:

I will test but I'm sure I just did exactly this - does it break your install?


Josh Cranwell comments:

I gota go home will be back in an hour


Hariprasad Vijayan comments:

if you use code like
add_action('password_reset', 'repsol_lost_password_reset_redirect');
It executes before resetting password. So just change its priority like
add_action('password_reset', 'repsol_lost_password_reset_redirect', 10, 2 );

It doesn't break..


Josh Cranwell comments:

This is the code I am using and the password reset does not work...


// NEW PASSWORD RESET REDIRECT
add_action('password_reset', 'repsol_lost_password_reset_redirect', 10, 2 );
function repsol_lost_password_reset_redirect( $user, $new_pass ) {
wp_redirect( home_url() );
exit;
}


It is broken :-(


Hariprasad Vijayan comments:

I think same thing you asked before [[LINK href="http://wpquestions.com/question/showChrono/id/8033"]]Check Link[[/LINK]]

2013-11-13

Just Me answers:

Try this


// NEW PASSWORD RESET REDIRECT

add_action('password_reset', 'repsol_lost_password_reset_redirect', 10, 2 );

function repsol_lost_password_reset_redirect( $user, $new_pass ) {
wp_set_password($new_pass,$user);
wp_redirect( home_url() );

exit;

}


You should probably check the variables for not being empty.


Josh Cranwell comments:

Thanks this looked so promising but it still does not work for some reason.

My password does not reset and the link does not expire.

I am going to deactivate all my plugins and functions and test this.


Josh Cranwell comments:

Haha you put me on the right track...

// NEW PASSWORD RESET REDIRECT
add_action('password_reset', 'repsol_lost_password_reset_redirect', 10, 2 );
function repsol_lost_password_reset_redirect( $user, $new_pass ) {
wp_set_password($new_pass,$user->ID);
wp_redirect( home_url() );
exit;
}

$user needed to be $user->ID


Thank you!!!

2013-11-12

Arnav Joy answers:

have you checked this link?

http://codex.wordpress.org/Login_Trouble


Josh Cranwell comments:

I have discovered old password still works, the password reset does not actually reset the password as old still works and the new password does not.

2013-11-12

Remy answers:

What's the code in your functions.php ?


Josh Cranwell comments:

Removed all functions this is not the problem.

I have discovered old password still works, the password reset does not actually reset the password as old still works and the new does not.

2013-11-12

S├ębastien | French WordpressDesigner answers:

what have you do recently ? Upgrade wordpress ? add a plugin ? change settings ? Upgrade or change your theme ? Add a code in functions.php ?
or change evrything in your db ? change a setting in phpmyadmin ?


Josh Cranwell comments:

Nope it was a long time since i done anything.

Still running...

I have discovered old password still works, the password reset does not actually reset the password as old still works and the new password does not. And the password link does not actually expire.

And this is the function that is causing the problem...

// NEW PASSWORD RESET REDIRECT
function repsol_lost_password_reset_redirect() {
wp_redirect( home_url() );
exit;
}
add_action('password_reset', 'repsol_lost_password_reset_redirect');


2013-11-12

phppoet answers:

follow this steps .

1. Deactivate caching (if any )
2. Delete wp-login.php file and replace it with fresh copy of wp-login.php from the wordpress zip of your version .


regards


Josh Cranwell comments:

This is the issue...

// NEW PASSWORD RESET REDIRECT
function repsol_lost_password_reset_redirect() {
wp_redirect( home_url() );
exit;
}
add_action('password_reset', 'repsol_lost_password_reset_redirect');


But I still need to redirect to the home page after password reset

2013-11-12

Bogdan answers:

Read here, maybe this can help you: village-idiot.org/archives/2007/05/22/wp-emergency-password-recovery/

LE: Or this: http://codex.wordpress.org/Resetting_Your_Password#Through_phpMyAdmin


Josh Cranwell comments:

This is the function that is causing the problem...

// NEW PASSWORD RESET REDIRECT
function repsol_lost_password_reset_redirect() {
wp_redirect( home_url() );
exit;
}
add_action('password_reset', 'repsol_lost_password_reset_redirect');


It redirects ok but I think it does not like the newer version on wordpress.