WooCommerce Social Login How Social Login Works

“WooCommerce Social Login” Documentation by “WPWeb”

Overview

WooCommerce Social Login takes a few steps during its login process to keep your customer accounts in sync with social accounts. It's helpful to know what steps it takes to link and create customer accounts to understand where certain issues can arise.

Here are the steps Woo Social Login takes to link or create customer accounts on your site:

  1. First Woo Social Login will try to search for the user via the email address provided by the social profile to see if the customer already has an account on your site. If the user is using the same email address for both the shop account and the social profile, this step with automatically link their social profile with their WordPress user account and successfully log the user in.
    Note that Twitter and Instagram are exceptions, as they do not provide an email address. Without an email address, Woo Social Login will not be able to successfully look up a pre-existing account.

  2. If a user is already logged into your site when they try to link an account, Woo Social Login will do a couple more checks:

    • If the user account found in the previous step does not match the logged-in user, the process will terminate with an error: "This account is already linked with another account."
    • If no user was found in the previous two steps, then the social profile will be linked to currently logged in customer's account for the future, as this means its a new social profile that no one else has used.

  3. Finally, if no user was found in the previous steps, a new customer account will be created.

Twitter and Instagram

You should be aware that Twitter and Instagram don't return an email address when the user logs in, so their WordPress account isn't tied to an email (just a username). While we can reasonably assume an email gives us a unique person, we can't make that assumption about a username, as the user can just enter whatever they want for a username on these networks.

This means that unlinking an account from Twitter or Instagram and then trying to log back in again will not link to the previous account. Instead, we create a new account for security to ensure we don't link two different people's accounts since we have no email address to work from.