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

267
Views
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 answers
Answer question

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 Report
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!