Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

83
Visualizações
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 Respostas
Responde à pergunta

0

the page has to refresh after the token is set.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda