This repository has been archived by the owner on Dec 3, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OauthReceiver allow custom fetch function
This PR fixes #28. It contains an enhancement to the
OauthReceiver
component. The aim is to allow the use of a custom fetch function since the one being used had some restrictions.Added
tokenFn
as an optional prop to theOauthReceiver
. As it says in the new documentation it should be aPromise
, if it's a function then it will be used as fetch, if not it will fall back to thefetch2
function that was originally being used.The
tokenFn
receives the same props asfetch2
. I don't think thatfetchTokenArgs
is needed in this case sincetokenFn
will probably already have the correct configuration for the project. I kept it just in case someone needs it.Documentation was edited to include this new enhancement and tests were added as well.
All tests are passing and I tested it in my own project and is working as well.
I am not an expert when writing tests so I'd appreciate any feedback on those and on the other changes as well.
If there is anything else I need to do in order to get this approved please let me know.