-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use universal-middleware
#16
base: main
Are you sure you want to change the base?
Conversation
Hi. I stumbled across this extension while trying to figure out the best way to deploy to Node and it looks awesome. The one issue I have is that I am using Auth.js for authentication and was previously using universal middleware to add the logged in user to the context. When I use the vike-node extension though, my modified context is not being seen by Vike so I assume it's using a different context. I'm assuming these draft changes will mean my context changes will be seen by Vike via the use of universal middleware...is that right? Not sure how far away these changes are, but is there another way that I can add the user to the context using regular middleware so that Vike will see that when I am using vike-node? |
@jasonhilldm I would suggest to wait for this PR to be finished, as it will fix your issue. import { getContext } from "@universal-middleware/hono";
app.use(
vike({
pageContext: (req) => getContext(req)
})
) |
Thank you - that worked perfectly. |
BREAKING CHANGE: cache related options have been removed
BREAKING CHANGE: `getPageContext` has been removed in favor of universal-middleware context. See [Updating the Context](https://universal-middleware.dev/recipes/context-middleware)
05aa8d6
to
775df55
Compare
Notable changes
@universal-middleware/compress
for compressiongetPageContext
hook is removed. The wholecontext
from universal middlewares is given as a Context torenderPage
. This means that the same effect can be achieved by any custom universal middleware.Next steps (not in this PR)