Skip to content

Instantly share code, notes, and snippets.

@bkonkle
Created November 27, 2016 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bkonkle/1d6fc2ad4eb37852db36128d5183f5b2 to your computer and use it in GitHub Desktop.
Save bkonkle/1d6fc2ad4eb37852db36128d5183f5b2 to your computer and use it in GitHub Desktop.
Electron Google Authentication (Part 4)
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
}
@krzysztofMlczk
Copy link

What should be the value of GOOGLE_REDIRECT_URI? Please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment