Gun5m0k3 Posted December 18, 2016 Report Share Posted December 18, 2016 (edited) Hi all, I am currently working on a Drupal 8 module which enables user to create a WoW account on registering. However, I am facing a problem: When I create a user in Drupal I see that the account table in the auth server gets filled with the correct data. On activating an account and updating its password it sets the new password correctly. But when editing your password again the SHA1 hash field in the database gets updated but the new password does not work. The old one still does work. I find this really strange since the SHA1 hash gets updated but the old password still works and the new one does not. Is there some sort of username/password cache in the authserver that needs to be reset on updating? Below is my insert and update code: INSERT $database->fields([ 'username' => strtoupper($username), 'sha_pass_hash' => strtoupper($password), 'sessionkey' => '0', 'v' => '0', 's' => '0', 'email' => $emailAddress, 'last_login' => '2000-01-01 00:00:00', ]); UPDATE $database->fields([ 'username' => strtoupper($newUsername), 'sha_pass_hash' => strtoupper($password), 'email' => $newEmailAddress, ]); P.S. I took the insert code from other PHP scripts and so I hope that I am doing the inserts and updates correctly. If not I would appreciate it if you could tell how to do it correctly. Edited December 18, 2016 by MrPerfect Link to comment Share on other sites More sharing options...
Shauren Posted December 18, 2016 Report Share Posted December 18, 2016 You need to clear sessionkey, s and v fields during update Link to comment Share on other sites More sharing options...
Gun5m0k3 Posted December 18, 2016 Author Report Share Posted December 18, 2016 Great that worked! As soon as my module is finished I will put it online in the forums. Thanks! Link to comment Share on other sites More sharing options...
Gun5m0k3 Posted December 22, 2016 Author Report Share Posted December 22, 2016 I released the first version of my module, you can find it here: Link to comment Share on other sites More sharing options...
Recommended Posts