Back to Supabase

Fetch Requests To Api Endpoints Arent Showing The Session UbUwRs

apps/docs/content/troubleshooting/fetch-requests-to-api-endpoints-arent-showing-the-session-UbUwRs.mdx

1.26.04276 B
Original Source

You must pass along the cookie header with the fetch request in order for your API endpoint to get access to the cookie from this request.

ts
const res = await fetch('http://localhost:3000/contact', {
  headers: {
    cookie: headers().get('cookie') as string,
  },
})