• Resolved vinay404

    (@vinay404)


    Hi,

    I am using houzez WordPress theme on my website, and I have enabled 2FA Settings on my website, it works in backend login at https://ghardwar.com/wp-admin

    But i am using a login page by theme here and it doesnt show any otp field to enter, https://www.ghardwar.com/login/

    or in header menu’s model login popup,

    It simply show an error at above the form The 2fa code you entered was incorrect.

    I am using the child theme of houzez, is there any code to add this otp to my theme files and override to add 2fa field ?

    here is my login-form.php code,

    <div id="hz-login-messages" class="hz-social-messages"></div>
    <form>
        <div class="login-form-wrap">
            <div class="form-group">
                <div class="form-group-field username-field">
                    <input class="form-control" name="username" placeholder="<?php esc_html_e('Username or Email','houzez'); ?>" type="text" />
                </div><!-- input-group -->
            </div><!-- form-group -->
            <div class="form-group">
                <div class="form-group-field password-field">
                    <input class="form-control" name="password" placeholder="<?php esc_html_e('Password','houzez'); ?>" type="password" />
                </div><!-- input-group -->
            </div><!-- form-group -->
        </div><!-- login-form-wrap -->
    
        <div class="form-tools">
            <div class="d-flex">
                <label class="control control--checkbox flex-grow-1">
                    <input name="remember" type="checkbox"><?php esc_html_e( 'Remember me', 'houzez' ); ?>
                    <span class="control__indicator"></span>
                </label>
                <a href="#" data-toggle="modal" data-target="#reset-password-form" data-dismiss="modal"><?php esc_html_e( 'Lost your password?', 'houzez' ); ?></a>
            </div><!-- d-flex -->    
        </div><!-- form-tools -->
    
        <?php get_template_part('template-parts/google', 'reCaptcha'); ?>
    
        <?php wp_nonce_field( 'houzez_login_nonce', 'houzez_login_security' ); ?>
        <input type="hidden" name="action" id="login_action" value="houzez_login">
        <input type="hidden" name="redirect_to" value="<?php echo esc_url(houzez_after_login_redirect()); ?>">
        <button id="houzez-login-btn" type="submit" class="btn btn-primary btn-full-width">
            <?php get_template_part('template-parts/loader'); ?>
            <?php esc_html_e('Login', 'houzez'); ?>        
        </button>
    </form>
    
    <?php if( houzez_option('facebook_login') == 'yes' || houzez_option('google_login') == 'yes' ) { ?>
    <div class="social-login-wrap">
    
        <?php if( houzez_option('facebook_login') == 'yes' ) { ?>
        <button type="button" class="hz-facebook-login btn btn-facebook-login btn-full-width">
            <?php get_template_part('template-parts/loader'); ?>
            <?php esc_html_e( 'Continue with Facebook', 'houzez' ); ?>
        </button>
        <?php } ?>
    
        <?php if( houzez_option('google_login') == 'yes' ) { ?>
        <button type="button" class="hz-google-login btn btn-google-plus-lined btn-full-width">
            <?php get_template_part('template-parts/loader'); ?>
            <img class="google-icon" src="<?php echo HOUZEZ_IMAGE; ?>Google__G__Logo.svg"/> <?php esc_html_e( 'Sign in with google', 'houzez' ); ?>
        </button>
        <?php } ?>
    
    </div>
    <?php } ?>
    

    Here is my modal-login-register.php file code

    <div class="modal fade login-register-form" id="login-register-form" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <div class="login-register-tabs">
                        <ul class="nav nav-tabs">
                            <li class="nav-item">
                                <a class="modal-toggle-1 nav-link" data-toggle="tab" href="#login-form-tab" role="tab"><?php esc_html_e('Login', 'houzez'); ?></a>
                            </li>
    
                            <?php if( houzez_option('header_register') ) { ?>
                            <li class="nav-item">
                                <a class="modal-toggle-2 nav-link" data-toggle="tab" href="#register-form-tab" role="tab"><?php esc_html_e('Register', 'houzez'); ?></a>
                            </li>
                            <?php } ?>
                        </ul>    
                    </div><!-- login-register-tabs -->
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div><!-- modal-header -->
                <div class="modal-body">
                    <div class="tab-content">
                        <div class="tab-pane fade login-form-tab" id="login-form-tab" role="tabpanel">
                            <?php get_template_part('template-parts/login-register/login-form'); ?>
                        </div><!-- login-form-tab -->
                        <div class="tab-pane fade register-form-tab" id="register-form-tab" role="tabpanel">
                             <?php get_template_part('template-parts/login-register/register-form'); ?>
                        </div><!-- register-form-tab -->
                    </div><!-- tab-content -->
                </div><!-- modal-body -->
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- login-register-form -->

    please help, I realy need this to work.

    Thanks and regards,

    Vinay Shukla

    Ghar Dwar Free Real Estate Property Listing Portal

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @vinay404.

    you should add to the <form id="loginform" we have below selectors for logniform

    ‘.tml-login form[name=”loginform”], .tml-login form[name=”login”], #loginform, #wpmem_login form, form#ihc_login_form, .bbp-login-form, .woocommerce form.login, #affwp-login-form, #wppb-loginform’;

    and below for the username.

    ‘[name=”log”], [name=”username”], #user_login, #affwp-login-user-login, #affwp-user-login, #gform_fields_login input[type=”text”], .um-field-username input[type=”text”]’

    Regards

    Thread Starter vinay404

    (@vinay404)

    ok, thanks for replying, i will try and let you know.

    Thread Starter vinay404

    (@vinay404)

    Hello, I have messed it up, Whenever i am login it straight goes to 403 page when plugin is active, I think i have been locked, because of failed login attempst,

    As of now i have removed all plugin files from file manager, .htaccess .ini and database tables too.

    I am able to login to the site but, when i tried to install the plugin again its straight goes to 403 whenever i acces the website,

    So i removed all plugin files and database tables again,

    Its an nginx server on cloudpanel,

    What should i do to make the plugin work again, is there anywher my id is in block list which i can remove to install the plugin again, or in database tables. please let me now

    as of now plugin is removed from site.

    Thread Starter vinay404

    (@vinay404)

    ok, I have managed to remove aioswp entries from wp_options table, now i m able to activate the plugin without any error

    I will check the frontend 2fa settings and let you know. thanks.

    Thread Starter vinay404

    (@vinay404)

    Hi,

    I have added the id selector in the form but its not working,

    I am getting this error in my frontend. Can you please let me know what i need to do ?

    errors:

    The one-time password (TFA code) you entered was incorrect. The "encrypt secrets" feature is currently enabled, but no encryption key has been found (set via the SIMBA_TFA_DB_ENCRYPTION_KEY constant). This indicates that either setup failed, or your WordPress installation has been corrupted.
    Go here for the FAQs, which explain how a website owner can de-activate the plugin without needing to login.

    also how do i add a otp input field and send otp button in this form

    Thread Starter vinay404

    (@vinay404)

    Hello, I have managed to add 2fa in the front end login form, and its working, here is the code which i have added for OTP Field, Can you please let me know the code to make it invisible if user has not setup 2fa ?

      		<div class="form-group">
          		<div class="form-group-field password-field">
      				<input class="form-control" type="text" name="two_factor_code" id="simba_two_factor_auth" placeholder="Enter your OTP" autocomplete="off" data-lpignore="true">
            	</div><!-- input-group -->
        	</div><!-- form-group -->
    Thread Starter vinay404

    (@vinay404)

    How can I show this OTP Field after user clicks on login if otp is enabled in his account and if not the form goes straight to login the user.

    Can you help, please

    Plugin Support hjogiupdraftplus

    (@hjogiupdraftplus)

    Hi @vinay404,

    As per my last comment you should have the form selector to change in extra of that you should have the login_enqueue_scripts do_action called which adds the tfa.js.

    Which will check it is login form and username if yes on username check does this user enabled TFA if yes it will add the TFA code filed by itself you do not need to add your own TFA code input.

    and authenticate filter used to verify code and filter.

    If you have standard login functionality it works automatically. for example for WooCommerce my-account page it works.

    Regards

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.