You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
The on-demand-entries-ping should include the current cookies in the request.
Current Behavior
The on-demand-entries-ping does not include the current cookies in the request.
Steps to Reproduce (for bugs)
If required, I can build an reproduction sample, but I think its obvious.
Context
I am running a nginx as proxy splitting the request between a website served with next, and multiple microservices. All running in docker. For development I am running the website with next in dev mode within the same docker context so that the api request are handled the same way as in prod, but on localhost. The nginx is also validating the session cookies against an authentication services and exchange them for an access_token if the request is forwarded to one of the backend services. The proxy is also blocking the access to the next app if there is no token.
Since the on-demand-entries-ping does not include the cookies, the request is blocked. As a workaround I could allow all _next/... requests with out cookies, but I think that there is no reason why the on-demand-entries-ping should not include the credentials.
It seems that the #2509 has been overwritten during merging of universal-webpack. @timneutkens Could we please bring { credentials: 'same-origin' } back? #3968
lockbot
locked as resolved and limited conversation to collaborators
May 16, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected Behavior
The on-demand-entries-ping should include the current cookies in the request.
Current Behavior
The on-demand-entries-ping does not include the current cookies in the request.
Steps to Reproduce (for bugs)
If required, I can build an reproduction sample, but I think its obvious.
Context
I am running a nginx as proxy splitting the request between a website served with next, and multiple microservices. All running in docker. For development I am running the website with next in dev mode within the same docker context so that the api request are handled the same way as in prod, but on localhost. The nginx is also validating the session cookies against an authentication services and exchange them for an access_token if the request is forwarded to one of the backend services. The proxy is also blocking the access to the next app if there is no token.
Since the on-demand-entries-ping does not include the cookies, the request is blocked. As a workaround I could allow all
_next/...
requests with out cookies, but I think that there is no reason why the on-demand-entries-ping should not include the credentials.Solution
Add
{ credentials: 'same-origin' }
as parameter to the fetch requests, here: https://github.com/zeit/next.js/blob/v3-beta/client/on-demand-entries-client.js#L14 and here: https://github.com/zeit/next.js/blob/v3-beta/client/on-demand-entries-client.js#L19.If this is an appropriate solution and you have no concerns I can send an PR, asap.
Your Environment
The text was updated successfully, but these errors were encountered: