Can't Find db-login.js

Im following the User Migration 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?

Hi @sean.walsh ,

Welcome to the Auth0 Community!

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

*
 * @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!

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