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

255
Vistas
Next-Auth: Why are there network requests with "useSession" on the client

I'm currently using next-auth for authentication. I have a piece of code that checks whether a session exists and renders a "signout" button based on that (this page is also SSG):

 {session && (
          <li>
            <Link href="/api/auth/signOut">
              <a
                onClick={(e) => {
                  e.preventDefault();
                  signOut();
                }}
              >
                Sign Out
              </a>
            </Link>
          </li>
        )}

However, when I do this, I see a flicker in my nav bar. I would think that there shouldn't be a flicker since the client already knows whether the session exists.

I've looked at the network requests, and I see that a request is made every time I reload the page. Why is this request necessary? Shouldn't the client already know whether a session exists or not without having to make a request?

enter image description here

about 4 years ago · Juan Pablo Isaza
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