• Resolved kalleaume

    (@kalleaume)


    In the form settings > ‘General’ > ‘User Approval and Login Option’, I have selected ‘Auto approval and auto login’. However, this is not working.

    Upon submitting the form successfully, the user’s account is auto approved in the background, however they are not automatically logged in. As a result, the user needs to login manually.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @kalleaume

    Thank you for writing in,

    It seems you have chosen the auto approval and manual login user login option from your particular form settings. Please edit your user registration forms, go to the form’s settings, and change the user login option according to your needs.

    Regards!

    Thread Starter kalleaume

    (@kalleaume)

    Hi @shresthauzwal, thanks for your reply informing me that I must have selected ‘Auto approval and manual login’. If that were the case, then this issue would be resolved!

    Unfortunately, though, you are incorrect. As I already mentioned in my first post, the setting I have chosen is ‘Auto approval and auto login’. Here is a screenshot of my setting: https://snipboard.io/R06Zhg.jpg

    I can also confirm that it is not due to a conflict with other plugins on my site, as I have tested another registration form plugin (WP User Manager) and the auto login setting on their form works perfectly on our site.

    Is there any other setting that could be preventing the auto login feature from working in your plugin? For example, does it not work when ‘Strong’ passwords are selected?

    Thread Starter kalleaume

    (@kalleaume)

    I can confirm that Auto-login is still not working, even if I remove all other settings from the form (Strong password etc).

    I can also confirm that auto-login works fine on our site using the Uncanny Codes Registration form (as well as in the WP User Manager plugin mentioned above). So there is nothing on our site that is preventing auto-login from occurring. The issue only seems to be when we use your plugin.

    Have you been able to replicate this issue at your end?

    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @kalleaume,

    The feature is working fine here and for other users as well. You can confirm via our support forums conversation. It might be a conflict between the plugin. Could you please refer to this documentation https://docs.wpeverest.com/user-registration/docs/how-to-check-plugin-theme-conflict/ and follow the instruction kindly? This will let you know the cause of the error.

    Let me know if it helps or not, and I will get back to you.

    Regards!

    Thread Starter kalleaume

    (@kalleaume)

    Thanks for your advice. I followed all of these steps and have found the conflict!

    The conflict is caused by the code snippet that you provided in this thread which creates the username based on the user’s full email address (not just the first part of their email address before the ‘@’ symbol).

    When I deactivate your code snippet, the Auto login feature of your plugin works again! But now this means that that usernames are only created with the first half of a user’s email address. Unfortunately, this means that if ‘[email protected]’ tried to register an account after ‘[email protected]’ registers an account, the form freezes because it detects a duplicate username (as described in the original thread).

    So can you please advise how we can have both issues fixed at the same time?

    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @kalleaume,

    Could you please provide us with the code snippet? We will look into it and get back to you accordingly.

    Regards!

    Thread Starter kalleaume

    (@kalleaume)

    The code snippet is the same one that you provided here: https://www.ads-software.com/support/topic/use-full-email-address-as-username/#post-16731490 (Also see below)

    Looking forward to your response!

    add_action( 'user_registration_after_register_user_action', 'ur_insert_username', 1, 3 );
    function ur_insert_username( $valid_form_data, $form_id, $user_id ) {
    global $wpdb;
    $user_email = isset( $valid_form_data['user_email'] ) ? $valid_form_data['user_email']->value : '';
    if( !empty($user_email)) {
    $wpdb->update(
    $wpdb->users,
    ['user_login' => $user_email],
    ['ID' => $user_id]
    );
    }
    }

    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @kalleaume,

    This custom code is provided for the old version before the major release of the plugin, so we will need to check the combability with the auto-approve and auto-login features.

    We will look into it in our testing environment and update code documentation https://docs.wpuserregistration.com/docs-category/dev-doc.

    We will close this thread because your auto approval and auto-login issue has been resolved. If needed, please create a new topic. We will get back to you as soon as possible.

    Regards!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Auto login not working’ is closed to new replies.