Commit graph

3 commits

Author SHA1 Message Date
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Vincent Voyer
f38eb70207
docs(examples): with-iron-session update (#12418) 2020-05-02 23:18:23 -04:00
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