Unverified Commit 50725188 authored by Vincent Voyer's avatar Vincent Voyer Committed by GitHub

docs(examples/with-iron-session): fix mutate + fetch, add TypeScript example link (#25889)

This updates the with-iron-session example with:
- updated way to mutate + fetch (re: https://github.com/vvo/next-iron-session/issues/329)
- updated readme to include TypeScript example link

Requirements:
- [x] Make sure the linting passes
parent ca2921fc
# Example application using [`next-iron-session`](https://github.com/vvo/next-iron-session)
---
<p align="center"><b>Online demo at <a href="https://next-iron-session.vercel.app/">https://next-iron-session.vercel.app/</a> 👀</b></p>
---
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 for authentication in the Next.js ecosystem.
On the next-iron-session repository (https://github.com/vvo/next-iron-session) you'll find:
- full API documentation and explanations on how it works
- [TypeScript example](https://github.com/vvo/next-iron-session/tree/master/examples/next-typescript)
- [JavaScript example](https://github.com/vvo/next-iron-session/tree/master/examples/next.js)
- [Express.js example](https://github.com/vvo/next-iron-session/tree/master/examples/express)
**Features:**
- [Static Generation](https://nextjs.org/docs/basic-features/pages#static-generation-recommended) (SG), recommended example
......@@ -15,13 +28,7 @@ It uses current best practices for authentication in the Next.js ecosystem.
[`next-iron-session`](https://github.com/vvo/next-iron-session) also supports:
- Express / Connect middlewares
- Multiple encryption keys (password) to allow for seamless updates or just password rotation
---
<p align="center"><b>Online demo at <a href="https://next-iron-session.vercel.app/">https://next-iron-session.vercel.app/</a> 👀</b></p>
---
- Multiple encryption keys (passwords) to allow for seamless updates or just password rotation
## Deploy your own
......
......@@ -20,8 +20,8 @@ const Login = () => {
}
try {
await mutateUser(
fetchJson('/api/login', {
mutateUser(
await fetchJson('/api/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment