In the async function getServerSideProps I need to make a fetch from the back-end where I include my credentials to instantiate a session. I have the following code:
export async function getServerSideProps({ query: { id } }) {
// Instantiate
await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/workflow/${id}`, {
method: 'GET',
credentials: 'include',
})
.then((response) => console.log('Instantiate...', response))
.catch((error) => console.error('Instantiation error', error));
}
The URL and all seem to work, but the console shows a 500 error because the credentials don't seem to be included in the fetch. When pasting the exact call in browser console/Postman, the response is a 200 code, so back-end seems to work correctly.