User Migration Configuration Missing Code


I’m receiving an error when signing up new users via custom database.

Login by Auth0 plugin v. 4.3.1

Through testing and troubleshooting, I ended up at the setting for our custom database and following these steps: User Migration in Login by Auth0 WordPress Plugin

When I ‘Save and Try’ the Login Script, I receive "Unexpected token < in JSON at position 0"

I tried to confirm my script was correct, but the link in the doc ( is no longer available.

Here is my script:

function login (email, password, callback) {
      var request = require("request");, {
        form:{username:email, password:password, access_token:configuration.migrationToken},
      }, function(error, response, body){
        if ( error ) {
          return callback(error);
        var info = JSON.parse(body);
        if (info.error) {
        } else {
          var profile = {
            email_verified: true,
          callback(null, profile);

I followed the troubleshooting steps on that doc:

  • My endpoint as site_url/index.php?a0_action= loads a page of random posts on my site.
  • My endpoint as site_url/index.php?a0_action=migration-ws-login returns {“status”:401,“error”:“Unauthorized”}
  • If I add callback(null, configuration); to the function, the return is "Returned user does not have an expected user_id value. If your Database Connection has enabled the \"Use my own database\" option, please make sure to return this attribute from the Login script."
  • I’ve confirmed with my host that the endpoint is not cached.
  1. Do you see any error in the script?
  2. How else can I troubleshoot the "Unexpected token < in JSON at position 0" error?

Thank you very much