This example shows how to use getInitialProps
to detect a user's
authenticated state during SSR. Static optimization is not supported
with this architecture. If you need to support static optimization
(hint: you should) then you should use the variation of this which
detects auth client-side. The architecture is explained in
this blog post.
This example is also available in TypeScript.
ssr
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||