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

Elaborate on refreshToken examples #2362

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

Conversation

taylorkline
Copy link
Contributor

I was silly and it took me a bit to realize that, just as with mutations and queries, the first argument to baseQuery can be a string in short form but a more verbose object argument may be provided. I think a longer form example will help people to realize how a custom baseQuery can work.

I was silly and it took me a bit to realize that, just as with mutations and queries, the first argument to `baseQuery` can be a `string` in short form but a more verbose object argument may be provided. I think a longer form example will help people to realize how a custom baseQuery can work.
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0b55cfe:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration

@netlify
Copy link

netlify bot commented May 27, 2022

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit 0b55cfe
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/6290fe32b4e22f0007039e75
😎 Deploy Preview https://deploy-preview-2362--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@phryneas
Copy link
Member

To be honest, I'd rather not show POSTing the refresh token, or people might start doing that - the most secure way here would be to have the refresh token set at login by the server as a httpOnly cookie that is never accessed from JavaScript.

I would be okay with { url: '... } I think, that should not distract too much from the real point of the example. 🤔
What do you think @markerikson ?

@taylorkline
Copy link
Contributor Author

taylorkline commented Jun 10, 2022

I see your point in the web space, but in React Native, we store the refresh token in biometric-protected keychain services / SharedPreferences, and fetch it out of that encrypted storage for refreshes. Though I see what you mean since most of the RTK Query examples are geared towards web.

@phryneas
Copy link
Member

Of course there are good reasons to do it - but they you know you want that - I just don't want to steer web users the wrong direction :)

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.

2 participants