This repo is contains example architectures for detecting the user's authenticated state client-side in Next.js when using an HttpOnly cookie. It was developed to support two blog posts:
- Detecting Authentication Client-Side in Next.js with an HttpOnly Cookie When Using SSR. This example uses
getInitialProps
and is available in two variations: - Detecting a User's Authenticated State Client-Side in Next.js using an HttpOnly Cookie and Static Optimization.