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 using Hono as a router and RPC client in my Astro app. I'm trying to figure out if there's a way to set variables with the .fetch function. I have middleware on the Astro side handling authorization, so I want to pass user and session objects to Hono when making a request. But it looks like fetch only takes bindings as the second parameter.
I tried passing user and session as Bindings, which works, but they don’t seem ideal for data specific to each request. The ultimate fix might be to create Hono middleware and skip using Astro locals, which I’ll probably do, but I’d still like to know if there’s a way to achieve this directly.
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
-
I'm using Hono as a router and RPC client in my Astro app. I'm trying to figure out if there's a way to set variables with the .fetch function. I have middleware on the Astro side handling authorization, so I want to pass user and session objects to Hono when making a request. But it looks like fetch only takes bindings as the second parameter.
I tried passing
user
andsession
as Bindings, which works, but they don’t seem ideal for data specific to each request. The ultimate fix might be to create Hono middleware and skip using Astro locals, which I’ll probably do, but I’d still like to know if there’s a way to achieve this directly.Beta Was this translation helpful? Give feedback.
All reactions