Skip to content

Commit 05430f4

Browse files
committed
πŸ› FIX: remove password & introduced payload
1 parent 2f8e969 commit 05430f4

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

β€Žutils/auth.jsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
Authorization: "",
3-
};
2+
Authorization: "msaaddev:525de88db1b12ade6800e5d0cd52e0d6455bff32",
3+
}

β€Žutils/createRepo.jsβ€Ž

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ module.exports = async () => {
2121
io.write(cyan("> Enter GitHub Username"));
2222
username = await io.read();
2323
io.write("");
24-
io.write(cyan("> Enter GitHub Password"));
25-
password = await io.read();
26-
io.write("");
2724
}
2825
io.write(cyan("> Enter Repo Title"));
2926
const title = await io.read();
@@ -40,17 +37,17 @@ module.exports = async () => {
4037
const auto_init = await io.read();
4138
io.write("");
4239

43-
/* const head = {
44-
Authorization: `Basic ${username}:${password}`,
45-
}; */
40+
const payLoad = {
41+
name: title,
42+
description,
43+
private,
44+
auto_init,
45+
};
4646

4747
await axios
48-
.post(`https://api.github.com/user/repos`, {
48+
.post(`https://api.github.com/user/repos?${headers.Authorization}`, {
4949
headers: headers,
50-
name: title,
51-
description,
52-
private,
53-
auto_init,
50+
body: JSON.stringify(payLoad),
5451
})
5552
.then((res) => {
5653
const name = "πŸ‘Œ DONE";

β€Žutils/user.jsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
username: "",
3-
};
2+
username: "msaaddev",
3+
}

0 commit comments

Comments
Β (0)