Shouldn't the Server Action fetch have an option to include credentials? #72912
-
Shouldn't the Server Action fetch (below) have an option to include credentials? From: const res = await fetch('', {
method: 'POST',
headers: {
Accept: RSC_CONTENT_TYPE_HEADER,
[ACTION_HEADER]: actionId,
[NEXT_ROUTER_STATE_TREE_HEADER]: encodeURIComponent(
JSON.stringify(state.tree)
),
...(process.env.NEXT_DEPLOYMENT_ID
? {
'x-deployment-id': process.env.NEXT_DEPLOYMENT_ID,
}
: {}),
...(nextUrl
? {
[NEXT_URL]: nextUrl,
}
: {}),
},
body,
}) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 16 replies
-
Since server actions POST to the same origin, they are included by default. |
Beta Was this translation helpful? Give feedback.
-
Follow-up question: If the server action response (from the backend server) contains cookies and a If not , is the only way to use an API endpoint instead? PS: I am using an Apollo Client to make the requests to the backend. I see a |
Beta Was this translation helpful? Give feedback.
Since server actions POST to the same origin, they are included by default.