Skip to content

Commit 8c11efe

Browse files
committed
update examples to oak 13
1 parent 72bd0b6 commit 8c11efe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Supports flash messages - session data that is deleted after it's read.
99
## Usage
1010

1111
```ts
12-
import { Application, Router } from "jsr:@oak/oak@^12";
12+
import { Application, Router } from "jsr:@oak/oak@^13";
1313
import { Session } from "https://deno.land/x/oak_sessions/mod.ts";
1414

1515
type AppState = {
@@ -29,7 +29,7 @@ const router = new Router<AppState>();
2929
app.use(Session.initMiddleware())
3030

3131
router.post('/login', async (ctx) => {
32-
const form = await ctx.request.body({type: 'form'}).value
32+
const form = await ctx.request.body.form()
3333
if(form.get('password') === 'correct') {
3434
// Set persistent data in the session
3535
ctx.state.session.set('email', form.get('email'))

test/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Application, Router } from "jsr:@oak/oak@^12"
1+
import { Application, Router } from "jsr:@oak/oak@^13"
22
import { Session } from '../mod.ts'
33
import { makeStore } from "./makeStore.ts";
44

@@ -25,7 +25,7 @@ app.use(Session.initMiddleware(store, {
2525
}))
2626

2727
router.post('/login', async (ctx) => {
28-
const form = await ctx.request.body({type: 'form'}).value
28+
const form = await ctx.request.body.form()
2929
if(form.get('password') === 'correct') {
3030
// Set persistent data in the session
3131
ctx.state.session.set('email', form.get('email'))

0 commit comments

Comments
 (0)