Skip to content

Commit 98a4cb4

Browse files
authored
🔧 fix: example in before handle (#230)
fix typo: onBeforeHandle is only available on global hook, not local hook
1 parent c3a2465 commit 98a4cb4

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,8 +37,8 @@ import { validateSession } from '@services/users'
3737

3838
new Elysia()
3939
.get('/', () => 'hi', {
40-
onBeforeHandle(({ set, cookie: { session } }) {
41-
if(!validateSession(session.value))
40+
beforeHandle({ set, cookie: { session } }) {
41+
if(!validateSession(session.value))
4242
return set.status = 'Unauthorized'
4343
}
4444
})

0 commit comments

Comments
 (0)