Closed aguscha333 closed 6 years ago
Hi, @aguscha333, Sorry I haven't responded yet. But I have a very busy work week right now. But I'll look into this in the beginning of next week!
hi @adambrgmn, Sure! no worries 😄.
@aguscha333 , great work! I like the implementation and it works fine for me as well! I'll merge this :)
:tada: This PR is included in version 1.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
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.