# Can't Find db-login.js

**URL:** <https://community.auth0.com/t/cant-find-db-login-js/91139>\
**Category:** Get Help\
**Tags:** wordpress-auth0\
**Created:** [September 22, 2022, 4:49pm UTC](https://community.auth0.com/t/cant-find-db-login-js/91139 "2022-09-22T16:49:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sean.walsh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sean.walsh/32/34226_2.png) [@sean.walsh](https://community.auth0.com/u/sean.walsh)\
**Post date:** [September 22, 2022, 4:49pm UTC](https://community.auth0.com/t/cant-find-db-login-js/91139/1 "2022-09-22T16:49:52Z")

</div>

Im following the [User Migration](https://auth0.com/docs/customize/integrations/cms/wordpress-plugin/user-migration-in-login-by-auth0#set-up-and-configuration) guide and under Set Up and Configuration number 8 there is a link to the github repository that errors out. Does anyone know where I can find that code?

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [September 30, 2022, 5:59pm UTC](https://community.auth0.com/t/cant-find-db-login-js/91139/3 "2022-09-30T17:59:13Z")

</div>

Hi @sean.walsh ,

Welcome to the Auth0 Community!

I could access to the GitHub repository. Here is the code.

```auto
*
 * @param {string} email - User email address, provided on login.
 * @param {string} password - User password, provided on login.
 * @param {function} callback - Function to call when the script has completed.
 */
function login (email, password, callback) {

  var request = require('request');

  request.post(
    configuration.endpointUrl + 'migration-ws-login',
    {
      form: {
        username: email,
        password: password,
        access_token: configuration.migrationToken
      }
    },
    function(error, response, body) {

      // Error encountered during HTTP request, exit.
      if (error) {
        return callback(error);
      }

      var wpUser = JSON.parse(body);

      // Error returned from WordPress or no data, exit.
      if (wpUser.error || ! wpUser.data) {
        return callback(null);
      }

      // Use WordPress profile data to populate Auth0 account.
      var profile = {
        user_id: configuration.userNamespace + '|' + wpUser.data.ID,
        username: wpUser.data.user_login,
        email: wpUser.data.user_email,
        name: wpUser.data.display_name,
        email_verified: true
      };

      callback(null, profile);
    });
}

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 14, 2022, 5:59pm UTC](https://community.auth0.com/t/cant-find-db-login-js/91139/4 "2022-10-14T17:59:45Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
