rsnext/examples/with-iron-session/components
Vincent Voyer 009369a9aa
docs(examples): add with-iron-session example (#10973)
This example creates an authentication system that uses a **signed and encrypted cookie to store session data**. It relies on [`next-iron-session`](https://github.com/vvo/next-iron-session).

It uses current best practices as for authentication in the Next.js ecosystem:
1. **no `getInitialProps`** to ensure every page is static
2. **`useUser` hook** together with [`swr`](https://swr.now.sh/) for data fetching

Features:
- Logged in status synchronized between browser windows/tabs
- Layout based on logged in status
- All pages are static
- Session data is signed and encrypted in a cookie
2020-04-07 10:47:00 -04:00
..
form.js docs(examples): add with-iron-session example (#10973) 2020-04-07 10:47:00 -04:00
header.js docs(examples): add with-iron-session example (#10973) 2020-04-07 10:47:00 -04:00
layout.js docs(examples): add with-iron-session example (#10973) 2020-04-07 10:47:00 -04:00