Last active
August 4, 2021 17:17
-
-
Save jackrobertscott/cb5f11cd7d77ee09ab74924b3ea0ef99 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 getGitHubUserData(access_token) { | |
| const { data } = await axios({ | |
| url: 'https://api.github.com/user', | |
| method: 'get', | |
| headers: { | |
| Authorization: `token ${access_token}`, | |
| }, | |
| }); | |
| console.log(data); // { id, email, name, login, avatar_url } | |
| return data; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment