Last active
August 13, 2021 23:32
-
-
Save jackrobertscott/5a2c21ca93b6cf024653a9b2a867d2e7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 axios from 'axios'; | |
async function getGoogleUserInfo(access_token) { | |
const { data } = await axios({ | |
url: 'https://www.googleapis.com/oauth2/v2/userinfo', | |
method: 'get', | |
headers: { | |
Authorization: `Bearer ${access_token}`, | |
}, | |
}); | |
console.log(data); // { id, email, given_name, family_name } | |
return data; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment