-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
import { Elysia, t } from 'elysia'
import { bearer } from '@elysiajs/bearer'
const routes = new Elysia()
.use(bearer())
.onBeforeHandle(({ set, bearer }) => {
// Bearer returns fine
console.log('onBeforeHandle bearer: ', bearer)
})
.onRequest((context) => {
// Authorization is found in headers
console.log('onRequest context: ', context.request.headers)
// But bearer returns undefined!
console.log('onRequest Bearer: ', context.bearer)
})
.get('/user', async (context) => {
// Bearer also returns ok here
console.log('Bearer: ', context.bearer)
})
stoplion, marekbuxobucek, armada45-pixel, mel-mouk, gitblit and 1 more
Metadata
Metadata
Assignees
Labels
No labels