Skip to content

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 force-pushed the fix/per-client-tokens branch from eee33cd to 6d64602 Compare June 30, 2021 05:07
@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