Automatic WordPress Login of Logged In ClickFunnels User

I have a client for whom I am building a ClickFunnel with the member area in LearnDash, an LMS that runs on WordPress. A key feature of this funnel is the ability to:

  1. Automatically add ClickFunnel customer to LearnDash membership for purchased product (done)
  2. Automatically create a WordPress Subscriber account upon successful purchase (done)
  3. Automatically log new member into WordPress
  4. Redirect to LearnDash Profile page (done)

Today, I realized that the automatic login requires cookies and session management. I’ve watched several videos on authentication, but didn’t see any examples where a user is logged in on one platform and is automatically logged into a second platform.

As far as I can tell, something like this needs to happen:

  1. In ClickFunnels, a member account is automatically created
  2. A cookie is set that includes the user’s email (to ensure it’s the same user)
  3. A WordPress user account is created
  4. The user is then authenticated and automatically logged in (assuming the same browser is used)

What I can’t figure out is how to use the customer’s ClickFunnels credentials to authenticate in WordPress. I definitely don’t want to send a plaintext password over the internet to Zapier or WordPress (I’m using Zapier to automatically create the user account in WordPress), yet it appears that I need that password to generate a hash with the same method as is used in ClickFunnels. If the password hashes match, then the user is logged into their LearnDash account and redirected to their profile page. Otherwise, they are redirected to the LearnDash/WordPress login page.

What is the best way to do this while keeping the user’s login information secure?

Thanks in advance!

Leave a Comment