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

Expose auth token in response headers #97

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

kellenmace
Copy link
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
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

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