Last active
March 10, 2019 05:49
-
-
Save Arjun-sna/5ef325627eeb4bd510a75aff4d598c33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Config from 'react-native-config'; | |
import axios from 'axios'; | |
const response = await axios(GITHUB_OAUTH_ENDPOINT, { | |
method: METHOD.POST, | |
headers: { | |
Accept: 'application/json', | |
'Content-Type': 'application/json', | |
}, | |
data: JSON.stringify({ | |
client_id: Config.CLIENT_ID, // Access CLIENT_ID env varaible using `Config` | |
client_secret: Config.CLIENT_SECRET, // Access CLIENT_SECRET env varaible using `Config` | |
code, | |
state, | |
}), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Js API call