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

99
Views
I am calling a authentication token using an api call but it keeps returning new tokens

I am sending an api call to cognito to get a jwtToken in return. I am using hooks for the API call but the issue is that I am getting infinite number tokens in return as the API call keeps getting data.

useEffect(() => {
    Axios.post(`${apiUrl}/api/auth/login`, loginInfo).then((res) =>
      setToken(res.data.accessToken.jwtToken)
    );
    Axios.get(getEventsUrl, config).then((response) =>
      setEventsData(response.data)
    );
  }, [loginInfo]);

How do I end only one request?

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!