access event.locals from a server function
Hey, I'm new to Solid.js and SolitStart.
I'm trying to implement PocketBase auth and got middleware setup:
is it possible to access event.locals inside a server function?
4 Replies
Have you tried
getRequestEvent()
?
that was it thanks!
im actually having issue with this line
it doesnt seem to actually set the cookie
-
FetchEvent
also contains nativeEvent
.
- vinxi/http
re-exports unjs H3 appendHeader()
.
Use appendHeader
with event.nativeEvent
and see if that works.GitHub
solid-start/packages/start/src/server/types.ts at 678d9acbc0bb669f8...
SolidStart, the Solid app framework. Contribute to solidjs/solid-start development by creating an account on GitHub.
Response - h3
Utilities to send response headers and data
GitHub
vinxi/packages/vinxi/runtime/http.js at e9f6a235c67bca6a904929e36ef...
The Full Stack JavaScript SDK. Contribute to nksaraf/vinxi development by creating an account on GitHub.
appendHeader and getHeader did help somewhat but it was an order of operations issue, I ended up doing this: and it works!