Skip to content

Commit 3f6a7a5

Browse files
committed
📦NEW: authorization
1 parent f2dc682 commit 3f6a7a5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎utils/getEmail.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ const io = require("console-read-write");
99
const { cyan } = require("chalk");
1010
const box = require("./box");
1111
const axios = require("axios");
12+
const headers = require("./auth");
1213

1314
module.exports = async () => {
1415
io.write("------------------------------------------");
1516
// getting data from terminal
1617
io.write(cyan("> Enter GitHub Username"));
1718
const URL = await io.read();
1819
await axios
19-
.get(`https://api.github.com/users/${URL}/events/public`)
20+
.get(
21+
`https://api.github.com/users/${URL}/events/public?access_token=${headers.Authorization}`,
22+
{
23+
headers: headers,
24+
}
25+
)
2026
.then((res) => {
2127
for (let i = 0; i < res.data.length; i++) {
2228
if (res.data[i].type === "PushEvent") {

0 commit comments

Comments
 (0)