Title: Account Linking problem
Last modified: December 28, 2018

---

# Account Linking problem

 *  Resolved [mmki](https://wordpress.org/support/users/mmki/)
 * (@mmki)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/account-linking-problem/)
 * Hi,
 * I have problem with account linking for some time.
 * It started around 2018-11-09, so 3.8.0 release might be the case.
    It affects
   new registered users (but only some of them). I suspect it has something to do
   with verified_email value.
 * In my workflow user registers to wp with a custom form. Then admin verifies this
   new account and approves it or deletes it from wp. In that period – when user
   is not yet verified by admin – user can’t login to wp.
 * I pass that verification status as email_verified value in custom database’s 
   scripts, in callback, along with id, name, nickname and email values.
 * Now, to the clue: if a user tries to log in to his account, before it is approved
   by the admin, an Auth0 account is created with ‘pending’ email status, but that
   account is not linked to that one in wp.
 * Then even if that status is changed in wp, and passed as email_verified with 
   true value, the wordpress account remains unlinked and for that unlinked account
   in Auth0 the email status remains as ‘pending’.
    I have to delete that unlinked
   account from Auth0 and the next time the user logs to wp with email_verified 
   status set to true, the linking works right.
 * What can I do to link accounts with email_verified state set to false or to prevent
   adding such accounts to auth0?
 * I found that there is a rule Account-Linking-Do-Not-Rename-NAME
 * I tried to comment those lines
 *     ```
        // Check if email is verified, we shouldn't automatically
         // merge accounts if this is not the case.
         if (!user.email_verified) {
           return callback(null, user, context);
         }
       ```
   
 * or even to additionaly remove the if-statement checking,
 *     ```
        if (targetUser.email_verified)
       ```
   
 * but the result is still the same.
    -  This topic was modified 7 years, 5 months ago by [mmki](https://wordpress.org/support/users/mmki/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [mmki](https://wordpress.org/support/users/mmki/)
 * (@mmki)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/account-linking-problem/#post-11039863)
 * Update: I checked up my extensions and set this rule to set manual in gitlab 
   deployments.
 * Now, with those lines commented it works:
 *     ```
       if (!user.email_verified) {
           return callback(null, user, context);
         }
       ```
   
 *  [Josh C](https://wordpress.org/support/users/auth0josh/)
 * (@auth0josh)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/account-linking-problem/#post-11044959)
 * [@mmki](https://wordpress.org/support/users/mmki/) – Glad you got it figured 
   out and thanks for checking back in 👍

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Account Linking problem’ is closed to new replies.

 * ![](https://ps.w.org/auth0/assets/icon-256x256.png?rev=3351758)
 * [Login by Auth0](https://wordpress.org/plugins/auth0/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auth0/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auth0/)
 * [Active Topics](https://wordpress.org/support/plugin/auth0/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auth0/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auth0/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Josh C](https://wordpress.org/support/users/auth0josh/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/account-linking-problem/#post-11044959)
 * Status: resolved