Releases: wobsoriano/nuxt-remote-fn
Releases · wobsoriano/nuxt-remote-fn
v0.1.25
v0.1.24
v0.1.23
🚀 Features
- Use built-in AsyncLocalStorage from async_hooks for event context access - by @wobsoriano (60d4a)
- Add useContext function - by @wobsoriano (2f1a6)
Usage
// todo.server.ts
export function createContext() {
const event = useEvent()
async function getUserFromHeader() {
const authorization = getRequestHeader(event, 'authorization')
if (authorization) {
const user = await decodeAndVerifyJwtToken(authorization.split(' ')[1])
return user
}
return null
}
event.context.user = await getUserFromHeader()
}
export async function addTodo(todo: Todo) {
const event = useEvent()
if (!event.context.user) {
throw createError({ statusCode: 401 })
}
// addTodo logic
}
View changes on GitHub
v0.1.22
No significant changes
View changes on GitHub
v0.1.20
No significant changes
View changes on GitHub
v0.1.19
🚀 Features
- Add more validation - by @wobsoriano (b3cab)
- Register handler for POST method only - by @johannschopplich #1
View changes on GitHub
v0.1.18
v0.1.17
🚀 Features
- Simplify event handler - by @wobsoriano (70ba0)
- Add ability to update extension - by @wobsoriano (7c12b)
View changes on GitHub
v0.1.16
No significant changes
View changes on GitHub
v0.1.14
No significant changes