We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9ae242 commit 4f8e399Copy full SHA for 4f8e399
docs/life-cycle/before-handle.md
@@ -37,7 +37,7 @@ import { validateSession } from '@services/users'
37
38
new Elysia()
39
.get('/', () => 'hi', {
40
- onBeforeHandle(({ cookie: { session } }) {
+ onBeforeHandle(({ set, cookie: { session } }) {
41
if(!validateSession(session.value))
42
return set.status = 'Unauthorized'
43
}
@@ -61,7 +61,7 @@ import { Elysia } from 'elysia'
61
62
.guard(
63
{
64
- beforeHandle({ cookie: { session } }) {
+ beforeHandle({ set, cookie: { session } }) {
65
if (!validateSession(session.value))
66
return (set.status = 'Unauthorized')
67
0 commit comments