cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid login or password.

Invalid login or password.

When a customer creates an account from checkout page, next time they try to login it gives an error.

 

"Invalid login or password."

 

 

I have tried adding this onto the login page, but didn't work:

<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />

 

However after resetting password it works.

 

Google recaptcha is turned off on this website as this is a testing site.

 

would you give me a suggestion?

 

This is Magento 1.9.4.0

14 REPLIES 14

Re: Invalid login or password.

@tvgarden 

Please make sure that you have added following code in correct file. You can check template files once.

To enable template path hints in Magento:

Login to the magento back-end.
Go to System - Configuration.
Go to Developer section on the bottom left under ADVANCED.
Switch to the store view on the top left to your current website or store view.
Open Debug and set “Template Path Hints” = Yes.

 

<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />


Template path for hint:

app/design/frontend/default/[themename]/template/persistent/checkout/onepage/login.php

app/design/frontend/default/[themename]/template/persistent/checkout/onepage/register.php 

 

Re: Invalid login or password.

Hello @tvgarden 

 

is that happen when customer try to register from checkout?

 

when you try to create an account from checkout is that automatically login after order placement.

 

if not then may be into your system may be varify email setting enabled.

https://www.youtube.com/watch?v=0vqYPrlSo0A

 

same thing into magento 1 as well. please check setting 

 

if help you then mark as a solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Invalid login or password.

Hi @Vimal Kumar 

It's using onestepcheckout.

 

I added the line onto both templates.

 

On checkout page:

template/onestepcheckout/billing_fields.phtml

<?php
$formErrors = $this->getParentBlock()->formErrors;
$formErrors = (!empty($formErrors['billing_errors'])) ? $formErrors['billing_errors'] : array();

$helper = Mage::helper('onestepcheckout/checkout');
$dataHelper = Mage::helper('onestepcheckout');

    $billingFields['firstname'] = '
        <div class="osc-short input-box input-firstname'.((in_array('firstname', $formErrors)) ? ' input-error' : '').'">
            <label for="billing:firstname">'.$this->__('First Name').' <span class="required">*</span></label><br />
            <input class="required-entry input-text" type="text" name="billing[firstname]" id="billing:firstname" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getFirstname()).'" />
        </div>';
    $billingFields['lastname'] = '
        <div class="osc-short input-box input-lastname'.((in_array('lastname', $formErrors)) ? ' input-error' : '').'">
            <label for="billing:lastname">'.$this->__('Last Name').' <span class="required">*</span></label><br />
            <input class="required-entry input-text" type="text" name="billing[lastname]" id="billing:lastname" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getLastname()).'" />
        </div>';
    ?>

<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />

...

On Login popup

template/onestepcheckout/login_popup.phtml

<div id="onestepcheckout-login-popup"  data-remodal-id="login-modal" class="oscmodal">
        <div class="onestepcheckout-popup-contents">
            <div id="onestepcheckout-login-popup-contents-forgot" style="display: none;">
                <h1><?php echo $this->__('Forgotten your password?'); ?></h1>
                <p><?php echo $this->__('Enter your email below and we\'ll send you a new password by email.'); ?></p>

                <form id="onestepcheckout-forgot-form">
             
                    <div id="onestepcheckout-forgot-loading" style="display: none;" class="loading-ajax-login">&nbsp;</div>
                    <div id="onestepcheckout-forgot-error" class="onestepcheckout-error" style="display: none;">&nbsp;</div>
                    <div id="onestepcheckout-forgot-success" style="display: none;">
                        <?php echo $this->__('We have now sent you a new password to your email address. Click the link below to return to login.'); ?>
                    </div>
                    <div id="onestepcheckout-forgot-table">
                        <div class="input-box">
                            <label for="id_onestepcheckout_email"><?php echo $this->__('Email address'); ?></label><br />
                            <input type="text" class="input-text" name="onestepcheckout_email" id="id_onestepcheckout_email" />
                        </div>
                        <div class="input-box input-button">
                            <button id="onestepcheckout-forgot-button" type="button" class="button"><span><span><?php echo $this->__('Send password'); ?></span><span></button>
                        </div>
                    </div>
                </form>
                <p><a href="javascript&colon;void(0);" id="onestepcheckout-return-login-link"><?php echo $this->__('Return to login'); ?></a></p>
            </div>

            <div id="onestepcheckout-login-popup-contents-login">
                <h1><?php echo $this->__('Login'); ?></h1>
                <p><?php echo $this->__('Please login with your email address and password.'); ?></p>
                <form id="onestepcheckout-login-form">
           
                    <div id="onestepcheckout-login-loading" style="display: none;" class="loading-ajax-login">&nbsp;</div>
                    <div id="onestepcheckout-login-error" class="onestepcheckout-error error error-msg" style="display: none;">&nbsp;</div>
                    <div id="onestepcheckout-login-table">
                        <div class="input-box">
                            <label for="id_onestepcheckout_username"><?php echo $this->__('Email address'); ?></label><br />
                            <input tabindex="100" type="text" class="input-text" name="onestepcheckout_username" id="id_onestepcheckout_username" />
                            <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
                        </div>
                        <div class="input-box">
                            <label for="id_onestepcheckout_password"><?php echo $this->__('Password'); ?></label><br />
                            <input type="password" tabindex="101" name="onestepcheckout_password" class="input-text" id="id_onestepcheckout_password" />
                            <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
                        </div>
                        <div class="input-box input-button">...
    login_popup = onestepcheckout_login_popup;
});
</script>

 

Re: Invalid login or password.

@Sunil Patel 

When customer creates an account, it logs in. 

The error occurs after they logout, and login.

Re: Invalid login or password.

@tvgarden 
As per your last comment that customer logged in after checkout but unable to login again.
then it is not form key issue.
It looks like encryption key issue while saving password during checkout.

Re: Invalid login or password.

Hi @Vimal Kumar 

What should we do to fix the issue?

Re: Invalid login or password.

@Vimal Kumar @Sunil Patel 

I need to fix this issue very quickly. Would someone tell me any suggestions?

Re: Invalid login or password.

@tvgarden 
This is very strange issue.

Which onestepcheckout extension are you using?

Please check admin configuration once, may be you found some clue there?

Which magento 1.x version you are using, have you also applied security patch?

Re: Invalid login or password.

@Vimal Kumar 

It's using this extension

https://www.onestepcheckout.com/

 

It works on other websites, also it works with default template on  the other website on the other server.