You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a couple of websites inside a pnpm monorepo. Some logic, like authentication, can be shared between them, so I created a separate package.
Is it possible to use the getRequestEvent function from the $app/server module inside this separate auth package?
My current solution is to create a server hook that stores every event in an AsyncLocalStorage and then re-implement getRequestEvent but I'd prefer to be able to use the official one if possible.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building a couple of websites inside a pnpm monorepo. Some logic, like authentication, can be shared between them, so I created a separate package.
Is it possible to use the
getRequestEvent
function from the$app/server
module inside this separate auth package?My current solution is to create a server hook that stores every
event
in anAsyncLocalStorage
and then re-implementgetRequestEvent
but I'd prefer to be able to use the official one if possible.Beta Was this translation helpful? Give feedback.
All reactions