DEV Community

Discussion on: Detecting a User's Authenticated State Client-Side in Next.js using an HttpOnly Cookie and Static Optimization

Collapse
 
kiliman profile image
Kiliman

Hmm. Interesting. I'm aware of that.

For some reason though, it was calling checkAuth every time I navigated to a new page. So I guess the question is, is that the expectation?

Anyway, thanks again. I've expanded on your sample to use Firebase authentication. Also instead of having to mark each page as requiring authentication or not, I default to require authentication and have a withoutAuth HOC for those pages that are meant to be public.