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

265
Vistas
How do I make a lot of api calls just once without slowing down the login process using nuxt

I'm currently working on a dashboard, and need to fetch a lot of info from APIs and make the info. available. And I need them to be available as soon as a user logs-in.

I'm using nuxt-auth for authentication and login.

Currently, I fetch the data on login, but it's making login take so long. And the more APIs I call, the longer it takes to log-in, and there are still a number of APIs to be consumed.

Making the API calls on mount of the concerned components seems really redundant.

Please recommend a better way to do this, that won't slow down the login time, and also allow me to make all the necessary API calls at once.

Vuejs,Nuxt.js, javascript.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you are using nuxt-auth you should be able to make the api call in then callback, it will not affect the login process at all because it will run after login process is successful. And you can also call your api request without using await keyword if they doesn't depend on each other, all requests will process simultaneously.

      await this.$auth
        .loginWith("local", {
          data: {
            email: this.email,
            password: this.password
          }
        })
        .then(() => {
          this.$router.push("/");
          // write your api requests down here
        }).catch((err) => {})
about 4 years ago · Juan Pablo Isaza Denunciar
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