hono
hono copied to clipboard
hc with Credentials?
Discussed in https://github.com/orgs/honojs/discussions/2291
Originally posted by lajbel March 1, 2024
Looks pretty obvious to have something like credentials
in the configuration of hc
, something like this
const authClient = hc<SomeType>("/api/auth/", {
headers: {} // You can already set headers!
credentials: "include",
});
I was searching here and there's only one option available to do this approach
const api = hc<AppType>("api/auth", {
fetch: (req, init) =>
fetch(req, {
...init,
credentials: "include", // Why not have all fetch options too?
})
})
RPC is pretty awesome, but some things are missing
You can see more details in #2291.
Fixed by #2592