Created
November 27, 2016 23:51
-
-
Save bkonkle/1d6fc2ad4eb37852db36128d5183f5b2 to your computer and use it in GitHub Desktop.
Electron Google Authentication (Part 4)
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
export async function fetchAccessTokens (code) { | |
const response = await axios.post(GOOGLE_TOKEN_URL, qs.stringify({ | |
code, | |
client_id: GOOGLE_CLIENT_ID, | |
redirect_uri: GOOGLE_REDIRECT_URI, | |
grant_type: 'authorization_code', | |
}), { | |
headers: { | |
'Content-Type': 'application/x-www-form-urlencoded', | |
}, | |
}) | |
return response.data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What should be the value of GOOGLE_REDIRECT_URI? Please help