I added ajax login form in my custom theme and it's working fine in chrome but in Mozilla when I try to log in it redirects me to the same page. I am unable to log in.

Here is my ajax code:

    ], function ($) {
        var dataForm = $('#form-login');
        dataForm.mage('validation', {});

        $('.action-login').on('click',function () {
                var formData = new FormData();
                formData.append('username', $('#form-login input[name="username"]').val());
                formData.append('password', $('#form-login input[name="password"]').val());
                    url: '<?php echo $block->getAjaxLoginUrl(); ?>',
                    data: formData,
                    processData: false,
                    contentType: false,
                    showLoader: true,
                    type: 'POST',
                    dataType: 'json',
                    success: function (response) {
                        if (!response.errors) {
                        } else {
                            $('.popup-login .form-login .messages .message div').text(response.message);
                            $('.popup-login .form-login .messages .message').show();
                            setTimeout(function() {
                                $('.popup-login .form-login .messages .message').hide();
                            }, 5000);
                return false;

Your Answer

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

Browse other questions tagged or ask your own question.