Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
auth0 Management Api NextJs not able to update metadata

Really struggling to get my head around authO management clients so I can update users information. I've created a Next.js API route for the backend but I'm not sure how to actually amend the user's data. I've followed the docs and got to the point below.

API route

The ID params I manually entered to test and my response is an empty JSON object.

The docs don't make it clear what I'm suppose to do in the update user area in.

var ManagementClient = require("auth0").ManagementClient;

export default async (req, res) => {
  var auth0 = new ManagementClient({
    domain: process.env.AUTH0_BASE_URL,
    clientId: process.env.AUTH0_CLIENT_ID,
    clientSecret: process.env.AUTH0_CLIENT_SECRET,
    scope: "read:users update:users",
  });
  var params = { id: "**************************" };
  var metadata = {
    foo: "bar",
  };

  auth0.users.updateAppMetadata(params, metadata, function (err, user) {
    if (err) {
      // Handle error.
    }

    // Updated user.
    console.log(user);
    res.status(200).json({ user });
  });
};

Error:

API resolved without sending a response for /api/authapi, this may result in stalled requests.
   SanitizedError [APIError]: getaddrinfo ENOTFOUND http
   (node:internal/process/task_queues:81:21) {
      statusCode: 'ENOTFOUND',
      requestInfo: { method: 'post', url: '***********' },
      originalError: Error: getaddrinfo ENOTFOUND http
          at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:69:26) {
        errno: -3008,
        code: 'ENOTFOUND',
        syscall: 'getaddrinfo',
        hostname: 'http',
        response: undefined
      }
    }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!