We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi
There is a certain case when you need to to check auth with updated headers, cause it makes sense, right?
In my project right now I am hacking this stuff by creating an options object somewhere and accessing it like that
import checkAuthOptions from '../lib/checkAuthOptions'
Then I'd modify it and because it's reference check auth will use updated object
Another way to do it is via observables but I don't want to bring them just to use in this case.
So my proposal is to make reqOptions either a function or object. So I'd write
reqOptions
const reqOptions = () => ({ method: 'POST', headers: { Authorization: localStorage.getItem('awesomeness-token') } })
And before doing any fetch check auth would execute this function to get current tokens and everything.
fetch
To maintain backward compatibility we can pass reqOptions as an object or a function
The text was updated successfully, but these errors were encountered:
Updated reqOptions to take a function that returns a fetch options ob…
3998972
…ject (#13) This solves #9
Resolved by #13
Sorry, something went wrong.
No branches or pull requests
Hi
Problem
There is a certain case when you need to to check auth with updated headers, cause it makes sense, right?
In my project right now I am hacking this stuff by creating an options object somewhere and accessing it like that
Then I'd modify it and because it's reference check auth will use updated object
Another way to do it is via observables but I don't want to bring them just to use in this case.
Proposal
So my proposal is to make
reqOptions
either a function or object. So I'd writeAnd before doing any
fetch
check auth would execute this function to get current tokens and everything.Backward Compatibility
To maintain backward compatibility we can pass reqOptions as an object or a function
The text was updated successfully, but these errors were encountered: