adambrgmn / react-oauth-flow

An OAuth2 flow for React apps
MIT License
94 stars 37 forks source link

Allow for fetch options #25

Closed jwright closed 6 years ago

jwright commented 6 years ago

This PR allows for the fetch args to be set via a prop for the OAuthReceiver component. This makes the component a little more general by allowing different services to override the default fetch options when fetching from the token service.

For example, the Facebook token service (https://graph.facebook.com/v3.0/oauth/access_token) requires a GET request but the Dropbox token service (https://api.dropboxapi.com/oauth2/token) requires a POST. This prop would allow the client to change the defaults.

This would also allow for additional headers to be set or the default Content-Type to be changed.

Closes #22

codecov-io commented 6 years ago

Codecov Report

Merging #25 into master will increase coverage by 0.95%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
+ Coverage   60.49%   61.44%   +0.95%     
==========================================
  Files           6        6              
  Lines          81       83       +2     
  Branches       20       20              
==========================================
+ Hits           49       51       +2     
  Misses         27       27              
  Partials        5        5
Impacted Files Coverage Δ
src/OauthReceiver/index.js 62.22% <100%> (+1.75%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a17a3fd...9a982a9. Read the comment docs.

jwright commented 6 years ago

@adambrgmn Is there anyway we can get this merged or reviewed? Let me know if there is anything I can do to help facilitate this at all.

adambrgmn commented 6 years ago

Hi @jwright! Sorry for my late reply! I have been on vacation for a while and will be for a few more days. So I will have to wait with the review a few more days!

But thanks a lot for your PRs, I'm very happy about them!

2 aug. 2018 kl. 15:44 skrev Jamie Wright notifications@github.com:

@adambrgmn Is there anyway we can get this merged or reviewed? Let me know if there is anything I can do to help facilitate this at all.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jwright commented 6 years ago

@adambrgmn No worries! Enjoy your vacation!

adambrgmn commented 6 years ago

Hi @jwright! Once again, thanks for both your PRs 😃 These contributions is actually the first contributions ever to any of my repos, so it's quite exciting for me!

adambrgmn commented 6 years ago

Hi again, I noticed that the release failed for some reason (guessing outdated deps). I'm gonna look into it asap and update the dev env and your contributions will be published.

adambrgmn commented 6 years ago

:tada: This PR is included in version 1.1.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: