We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
5.1.0
10.0.01
22.0.0
macOS
Ventura 13.6.6
I'm not 100% sure if this is an issue with fastity/session or fastify/http-proxy.
I can get values from the session on normal routes. For example.
export default async function getImage(request, reply) { const id = request.params["*"]; try { const access_token = request?.session?.get('access_token') || null;
However, when I try in the preHandler in http-proxy plugin, it doesn't return anything, it's undefined.
fastify.register(fastifyHttpProxy, { upstream: process.env.NODE_ENV === "production" ? "http://xxxxxx:8080" : "https:/xxxxxx/v1/graphql", // Replace with your Docker container's address prefix: "/hasura", // The prefix for the proxy route rewritePrefix: "/", preHandler: (request, reply, done) => { const access_token = request?.session?.get('access_token') || null; console.log("Got access token from session", access_token); done(); },
I'm setting the trustProxy to true, but still nothing. Like I say - all other routes work.
Any ideas?
No response
The session should be available in the preHandler on @fastify-httpproxy
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Prerequisites
Fastify version
5.1.0
Plugin version
10.0.01
Node.js version
22.0.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
Ventura 13.6.6
Description
I'm not 100% sure if this is an issue with fastity/session or fastify/http-proxy.
I can get values from the session on normal routes. For example.
However, when I try in the preHandler in http-proxy plugin, it doesn't return anything, it's undefined.
I'm setting the trustProxy to true, but still nothing. Like I say - all other routes work.
Any ideas?
Link to code that reproduces the bug
No response
Expected Behavior
The session should be available in the preHandler on @fastify-httpproxy
The text was updated successfully, but these errors were encountered: