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

247
Views
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
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!