Skip to content

Expose auth token in response headers#97

Merged
jasonbahl merged 5 commits intowp-graphql:developfrom
kellenmace:feature/expose-auth-token-in-response-headers
Oct 24, 2024
Merged

Expose auth token in response headers#97
jasonbahl merged 5 commits intowp-graphql:developfrom
kellenmace:feature/expose-auth-token-in-response-headers

Conversation

@kellenmace
Copy link
Copy Markdown
Contributor

@kellenmace kellenmace commented Jun 22, 2020

Expose auth token in response headers so it can be used to update the auth token stored on the client, similar to what's shown in this Apollo link: https://github.com/benawad/slack-clone-client/blob/31_fix_auto_refresh_of_jwt_tokens/src/apollo.js#L18-L36

We are doing this already with the refresh token. This PR merely exposes the auth token, too.

Closes #98

@kellenmace
Copy link
Copy Markdown
Contributor Author

I've released a YouTube video showing folks how to use the new authToken that comes back to update the authToken they have stored in their app, but it won't actually work until this PR gets merged :)

My Apollo Link that handles getting the x-jwt-auth header and saving it in memory for that app (along with the refresh token) is here: https://github.com/kellenmace/run-through-history-frontend/blob/main/src/services/apollo.js#L126-L151

@jasonbahl jasonbahl merged commit 5d20262 into wp-graphql:develop Oct 24, 2024
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.

Expose auth token in response headers

2 participants