• Resolved Leif Harmsen

    (@leifharmsen)


    I’ve created a problem for my client LIFT. I made them a Woocommerce store through which many users had registered themselves. I use External Login, using LIFT’s external database of people so LIFT admin can log in to the dashboard and current LIFT members can log in to enjoy cheaper prices at the store. I have discovered that members can not log in if they had happened to have already registered themselves with a different username (typically firstname.lastname format) using their same email address that is in our membership database! It fails silently but I figured out that the failure is because each user must have a unique email in WordPress. I just fixed this for existing users with this:

    UPDATE wordpress.wp_users A
    INNER JOIN lift.person B ON A.user_email = B.email
    SET A.user_login = B.id

    However, to make this problem really go away – it would be great if when External Login tries to update the wp database and can’t because the same email already exists – it would go ahead and update the record with the matching email address, changing the user_login to the id from the external database as required.

    Is this an issue you’ve come across before? Would this be an easy change, feature, option?

Viewing 1 replies (of 1 total)
  • Plugin Author tbenyon

    (@tbenyon)

    Hey Leif,

    Great question.

    The biggest blocker on this is I hanven’t worked on this for over 3 years so would have to get myself familiar again with how it identifies users etc.

    The code is publicly available if you were super keen to make a pull request to add the feature.

    However, there is an added way for people to add any required customisations. You’ll find in the documentation about hooks one named exlog_hook_action_authenticated that gives an example of updating user data (though custom data – not default e-mail address).

    Hope this helps but let me know if you have any more questions ??

Viewing 1 replies (of 1 total)
  • The topic ‘Can not login if User already registerd self with same email .’ is closed to new replies.