credentials = 'include' not sending cookies server-side in plugin
We have an ofetch plugin that sets some things in
onRequest
, this includes a options.credentials = 'include'
. The option works fine (we can log it), but somehow the browser's cookies are never actually sent.
Adding credentials: 'include'
in useFetch
works, but we need this option globally for all our API endpoints1 Reply
We use this logic in the plugin: https://nuxt.com/docs/getting-started/data-fetching#pass-client-headers-to-the-api
But it's not sending cookies on the server still. It's a little frustrating tbh 😬
Nuxt
Data fetching · Get Started with Nuxt
Nuxt provides composables to handle data fetching within your application.