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

82
Views
have issue with token in react

my problem is that I get the token from the backend and I set it to local storage but when the user logs into the account data won't show to the user. but when the user refreshes the page, data would show to the user. what do you think is the problem? thank you for your time!

    const dashboardHeader = async () => {
    await axios.get('adminPanel/dashboard', {
        params: {
            fromDate: 'notSet',
            toDate: 'notSet'
        }
    })
    .then(res => {
        setHeaderData(res?.data?.result?.header)
        setLoading(false)
    })
    .catch(err => {
        console.log(err)
    })
}

this is one of my api examples

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

the page has to refresh after the token is set.

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!