Skip to content

Commit 4f8e399

Browse files
committed
📘 doc: missing set in beforeHandle
1 parent c9ae242 commit 4f8e399

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/life-cycle/before-handle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { validateSession } from '@services/users'
3737

3838
new Elysia()
3939
.get('/', () => 'hi', {
40-
onBeforeHandle(({ cookie: { session } }) {
40+
onBeforeHandle(({ set, cookie: { session } }) {
4141
if(!validateSession(session.value))
4242
return set.status = 'Unauthorized'
4343
}
@@ -61,7 +61,7 @@ import { Elysia } from 'elysia'
6161
new Elysia()
6262
.guard(
6363
{
64-
beforeHandle({ cookie: { session } }) {
64+
beforeHandle({ set, cookie: { session } }) {
6565
if (!validateSession(session.value))
6666
return (set.status = 'Unauthorized')
6767
}

0 commit comments

Comments
 (0)