NextAuth.js Client Side Example
If data on a page is fetched using calls to secure API routes - i.e. routes which use
getSession()
or getToken()
to access the session - you can use the useSession
React Hook to secure pages.
See https://next-auth.js.org/tutorials/securing-pages-and-api-routes#client-side