Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

319
Vistas
Is there a way to "pass" the user.name of auth0 user to a async function?

I'm creating a next.js app which reads a custom post type from a wordpress multisite. I want when a user sign-in (using auth0), the name of the user to go in the wordpress URL to replace the "site" name.

For example: I have this code in utils/wordpress.js

const BASE_URL = "https://fsm.xristosavgeros.com/sitename/wp-json/wp/v2/work";

export async function getPosts() {
  const postsRes = await fetch(BASE_URL + "?_embed");
  const posts = await postsRes.json();
  const filterPosts = posts.filter((post) => post.assigned_to == 'Johnny Worker');
  return filterPosts;
  }

What I need is something like this:

const BASE_URL = "https://fsm.xristosavgeros.com/ + user.name + /wp-json/wp/v2/work";

I think the way to go is useUser() hook but no matter where i tried to use it, the app crashes.

Any ideas?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda