Support

Home Forums WP User Integration Log auto created new user in

Log auto created new user in

Posted: March 11, 2024 at 9:57 pm


c.barthe@futurelearning.fr

March 11, 2024 at 9:57 pm

We are using WP User Integration to auto create new users when they register for an event. Once they have registered for the event and gone through the process of registering a new account, is it possible to have them logged in (redirected to the logged in home page) so they can access the site (without having to go to their email, click the set password link, set their password, then log in)?

Hopefully that makes sense?

I’m happy to create some code where needed.


Sam

  • Support Staff

March 11, 2024 at 10:37 pm

Hi Antoine,

Just to confirm, you want to auto-create a new user when there is a registration but don’t want them to create their password to enter the website right?

If so then you just need to edit the event and at the right sidebar in user integration section you can set the “Force Login for registrations?” to “no”
and set the “Auto Create users with registrations?” to “Yes”:

https://tinyurl.com/2bcr2u7f

Hope that helps.


c.barthe@futurelearning.fr

March 11, 2024 at 11:08 pm

Hi Sam,

Thanks for the quick response. If I use the settings as described, when a new user registers for an event, I get the successful event registration page, the new user’s WP account is created, but the user is not logged into our site (we use buddyboss as a member plugin). After successfullt registering for the event, to be able to log into the site, they have to go to their emails, click the create password link in the email sent to them, go through that process to set a password, then get taken back to the login page, and finally login using their email and password they just set.

We would like the user to automatically be logged in to our site on successful registration. They can still through the process of setting their password later, but we want them to have immediate access. (The event is a process we are using to enrol learners in an online course, hence wanting to take them to the home page which lists their enrolled courses).

As I understand, WP User Integration settings creates a random password to create the WP user account, so I am wondering if I can hook into something to redirect the user to the logged in home page when the account is created. Currently, our site stays on the event registration success page.

Does that clarify it any?


Tony

  • Support Staff

March 12, 2024 at 7:11 am

Hi there,

The user account is created at the end of the attendee information step rather than the end of the checkout process, so you can’t redirect the user when the account is created as it will interrupt the checkout process.

However, you can hook in and log them in when the user account is created. The add-on fires this hook:

AHEE__EED_WP_Users_SPCO__process_wpuser_for_attendee__user_user_created

You can hook and use the wp_sigon() function to authenticate the user.

Once they have completed the registration they will still need to go to the hoe page themselves but should be logged in for the current session.


c.barthe@futurelearning.fr

March 12, 2024 at 8:01 pm

Thanks Tony – much appreciated again. We use Buddyboss, and it seems it is triggering the activation process before that hook fires – which makes sense. So I’m working on a way around activation to have a seamless user experience but not compromise security too much and still require the activation process for following login’s. But that’s not your issue ๐Ÿ˜‰


Tony

  • Support Staff

March 13, 2024 at 4:25 am

The activation process you are referring to is actually a part of WordPress core itself and it will likely be the WP User integration add-on triggering it.

\eea-wp-user-integration\EED_WP_Users_SPCO.module.php

You’ll see what I mean there ๐Ÿ™‚

AHEE__EED_WP_Users_SPCO__process_wpuser_for_attendee__user_user_created is used by EED_WP_Users_SPCO::new_user_notifications, its how WP core does it, so EE follows.

The support post ‘Log auto created new user in’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso