Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with API Proxy #419

Open
standuprey opened this issue Oct 23, 2015 · 0 comments
Open

Issues with API Proxy #419

standuprey opened this issue Oct 23, 2015 · 0 comments

Comments

@standuprey
Copy link

I think the proxying is fine and it separates the api from the "front-end" nicely.
I am having a little bit more trouble finding a good reason why ApiClient is making a request to the proxy server. This seems overkill and complicate things. Unfortunately I don't have a better solution.

I am running into this issue: after passport login, during the redirect, it tries to make the loadAuth request while the cookie is not set yet. (Why the store I am using is answering and passport adds the user to req before the session is actually is a mystery I tried to solve to no avail) The result is that this call does not have the cookie and it looks like I am not logged in. Only after a page refresh it looks like I am logged in.

My workaround for the moment is to add a ssr=false query param when the user logs in. And do the following in server.js. This way, the client is doing the authLoad

if (__DISABLE_SSR__ || req.query.ssr === 'false') {
  hydrateOnClient();
  return;
}

I want to find a better solution when I get the time
Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant