apollo icon indicating copy to clipboard operation
apollo copied to clipboard

fix: per-client `tokenName` from config files

Open sgarner opened this issue 4 years ago • 2 comments

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 avatar Jun 30 '21 05:06 sgarner

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 avatar Jun 30 '21 05:06 sgarner

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

sgarner avatar Jun 30 '21 05:06 sgarner