XGhozt Posted January 5, 2012 Share Posted January 5, 2012 I've searched around the forums and google for a solution and I have not found one. For some reason when I try login to the store as a guest, I am returned with an "authentication failed" error. I know it is sending the data, because if I put the wrong password, it says "invalid password". This just suddenly started happening, the last thing I did was upgrade to version 1.4.6.2. Does anyone know what causes this and more importantly, what I can do to fix it? Link to comment Share on other sites More sharing options...
El Patron Posted January 5, 2012 Share Posted January 5, 2012 I think the cookie key to encrypt is changed. If you have back up of your existing site. Try to use old one to see if it solve you problem. The cookie key is defined in file /config/settings.inc.php define('_COOKIE_KEY_', 'WmkfhewfhehuueiwgeguiwguwegGewPveM0cSZmGgQD'); from: http://www.prestashop.com/forums/topic/94269-01authentication-failed-error/ Link to comment Share on other sites More sharing options...
XGhozt Posted January 5, 2012 Author Share Posted January 5, 2012 The COOKIE_KEY did not change, the problem must be with a new setting in relation to the guest checkout. I followed the code back to the SQL statement and ran it manually to narrow it down. /classes/Customer.php public function getByEmail($email, $passwd = NULL) { if (!Validate::isEmail($email) OR ($passwd AND !Validate::isPasswd($passwd))) die (Tools::displayError()); $result = Db::getInstance()->getRow(' SELECT * FROM `'._DB_PREFIX_ .'customer` WHERE `active` = 1 AND `email` = \''.pSQL($email).'\' '.(isset($passwd) ? 'AND `passwd` = \''.md5(pSQL(_COOKIE_KEY_.$passwd)).'\'' : '').' AND `deleted` = 0 AND `is_guest` = 0'); if (!$result) return false; $this->id = $result['id_customer']; foreach ($result AS $key => $value) if (key_exists($key, $this)) $this->{$key} = $value; return $this; } I removed: AND `is_guest` = 0 from the query, and it started working. Apparently before guest checkout existed in the older version of prestashop this column in the database doesn't exist. So, when we do an upgrade, the detault value is 1, which means all existing customers are now treated as guests. This means no one can authenticate because of the aformentioned. I find it odd that this is part of the query in the first place, because even when you checkout as a guest, the customer account is created. Link to comment Share on other sites More sharing options...
lettersets Posted June 4, 2012 Share Posted June 4, 2012 I find it odd that this is part of the query in the first place, because even when you checkout as a guest, the customer account is created. Did you manage to get this fixed? I get the same error message "Authentication Failed" when trying to log in from the shopping cart. It works fine if you log in using the my-account link. Also, customer accounts are created for all guests. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now