File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -19,22 +19,22 @@ import { Elysia } from 'elysia'
1919import Playground from ' ./components/nearl/playground.vue'
2020
2121const profile1 = new Elysia ()
22- .onBeforeHandle (({ status }) => status (401 ))
23- .get (' /profile' , ({ status }) => status (401 ))
22+ .onBeforeHandle (({ status }) => status (401 )) // or status("Unauthorized")
23+ .get (' /profile' , ({ status }) => status (401 )) // or status("Unauthorized")
2424
2525const demo1 = new Elysia ()
2626 .use (profile1)
2727 // This will NOT have sign in check
2828 .patch (' /rename' , () => ' Updated!' )
2929
3030const profile2 = new Elysia ()
31- .onBeforeHandle ({ as: ' global' }, ({ status }) => status (401 ))
32- .get (' /profile' , ({ status }) => status (401 ))
31+ .onBeforeHandle ({ as: ' global' }, ({ status }) => status (401 )) // or status("Unauthorized")
32+ .get (' /profile' , ({ status }) => status (401 )) // or status("Unauthorized")
3333
3434const demo2 = new Elysia ()
3535 .use (profile2)
3636 // This will NOT have sign in check
37- .patch (' /rename' , ({ status }) => status (401 ))
37+ .patch (' /rename' , ({ status }) => status (401 )) // or status("Unauthorized")
3838</script >
3939
4040# Key Concept <Badge type =" danger " text =" MUST READ " />
You can’t perform that action at this time.
0 commit comments