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

fix: per-client tokenName from config files #403

Open
wants to merge 1 commit into
base: v4
Choose a base branch
from

Conversation

sgarner
Copy link

@sgarner sgarner commented Jun 30, 2021

Fixes #386

When defining multiple apollo clients in external files, the tokenName for each client would not be set correctly in the compiled plugin.

This PR changes the template so that the tokenName is read after reading the config file instead of before.

@sgarner sgarner changed the title Use per-client tokenName from config files fix: per-client tokenName from config files Jun 30, 2021
@sgarner
Copy link
Author

sgarner commented Jun 30, 2021

Note that an issue remains with the implementation of onLogin in $apolloHelpers, which always sets cookies using the default AUTH_TOKEN_NAME regardless of which client is in use.

I don't see an obvious solution to that since there is no way to relate the passed in client object back to a configured client name to determine which token to use.

Ideas for that welcome, but this PR at least fixes the issue with the wrong token being sent in requests.

@sgarner
Copy link
Author

sgarner commented Jun 30, 2021

BTW the failing build has nothing to do with this PR and looks like it has been broken for a while 😬

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

Successfully merging this pull request may close these issues.

Apollo tokenName is always the same
1 participant