2

When a customer logs in with the incorrect password, we used to have an error message pop up but now it just refreshes the page with no error message and i haven't edited the login.phtml file, could anyone tell me why this is happening, please.

This is my login.phtml

<div class="account-login">

    <div class="block block-login">
        <div class="block-slider">
            <ul class="slides">
                <li>
                    <div class="block-title">
                        <strong><span><?php echo $this->__('Sign In') ?></span></strong>
                    </div>
                    <div class="block-content">

                        <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
                        <?php /* Extensions placeholder */ ?>
                        <?php echo $this->getChildHtml('customer.form.login.extra')?>

                        <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
                            <ul class="form-list">
                            <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
                                <li>
                                    <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
                                    <div class="input-box">
                                        <input type="text" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
                                    </div>
                                </li>
                                <li>
                                    <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
                                    <div class="input-box">
                                        <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
                                    </div>
                                </li>
                                <?php echo $this->getChildHtml('form.additional.info'); ?>
                            </ul>

                            <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
                            <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="forgot-password" id="forgot-password"><?php echo $this->__('Forgot Your Password?') ?></a>

                        </form>
                    </div>
                </li>
                <li>
                    <div class="block-title">
                        <strong><span><?php echo $this->__('Forgot Your Password?') ?></span></strong>
                    </div>
                    <div class="block-content">
                        <form action="<?php echo $this->getUrl('*/*/forgotpasswordpost') ?>" method="post" id="form-validate">
                            <ul class="form-list">
                                <li>
                                    <label for="email" class="required"><?php echo $this->__('Email Address') ?></label>
                                    <div class="input-box">
                                        <input type="text" name="email" alt="email" id="email_address" class="input-text required-entry validate-email" value="<?php echo $this->htmlEscape($this->getEmailValue()) ?>" />
                                    </div>
                                </li>
                                <?php echo $this->getChildHtml('form.additional.info'); ?>
                            </ul>
                            <button type="submit" class="button" title="<?php echo $this->__('Submit') ?>"><span><span><?php echo $this->__('Submit') ?></span></span></button>
                            <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="forgot-password" id="back-login"><?php echo $this->__('Back to Login?'); ?></a>
                        </form>
                    </div>
                </li>
            </ul>
        </div>
        <div class="new-users">
            <button type="button" title="<?php echo $this->__('Create an Account') ?>" class="button invert" onclick="window.location='<?php echo $this->getCreateAccountUrl() ?>';"><span><span><?php echo $this->__('Create an Account') ?></span></span></button>
        </div>
    </div>

    <script type="text/javascript">
        //<![CDATA[
        var dataForm = new VarienForm('login-form', true);
        var dataForgetForm = new VarienForm('form-validate', true);
        //]]>
    </script>
</div>
  • Do you have any caching modules enabled? – Dave Nov 19 '14 at 10:45
  • No we dont have nay cache modules – Adam Allen Nov 19 '14 at 10:47
  • Did you change your store URL? It could be that the cookie domain is incorrect. You could empty the var/session folder to clean any previous sessions. – Niels Dec 16 '14 at 10:25
  • No not changed the URL, tried to empty the session folder but no luck – Adam Allen Dec 16 '14 at 11:05
  • Check your Javascript code, if it open a popup, then JS make a ajax request to check the login credentials and trigger the popup on error. Google Chrome Console can show you what error are happening. – mateussouzaweb Dec 16 '14 at 13:57
2

This could be caused by a wrong template file, I have seen situations where the persistent shopping cart template file was used (even when this function is switched off).

Check if your template has a template/persustant/customer/form/login.phtml file and remove this (or replace with a correct version from base/default).

If you have the persistent shopping cart enabled, try it with this option disabled System=>Configuration=>Customer=>Persistent Shopping Cart=>Enable=>Set to No.

1

The request is processing by customer account controller Mage_Customer_AccountController::loginPostAction(). File location is

app/code/core/Mage/Customer/controllers/AccountController.php Dig from here. I think the error that is generated when password do not match in customer model. ie Mage_Customer_Model_Customer::authenticate(). There you can see this part

File: app/code/core/Mage/Customer/Model/Customer.php

 if (!$this->validatePassword($password)) {
            throw Mage::exception('Mage_Core', Mage::helper('customer')->__('Invalid login or password.'),
                self::EXCEPTION_INVALID_EMAIL_OR_PASSWORD
 }

Dig more with this info

  • It adds an error if the authentication fails $session->addError($message); but how can I render the error in the frontend? – Black Jan 23 '19 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.