Skip to content

Commit 1f04c76

Browse files
committed
fixed the variable name and spacing
1 parent 468b057 commit 1f04c76

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

controllers/users.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ const filterUsers = async (req, res) => {
467467
// one time script function to perform the migration - adding github_user_id field to the document
468468
const migrate = async (req, res) => {
469469
const authToken = `${config.get("githubOauth.clientId")}:${config.get("githubOauth.clientSecret")}`;
470-
const base64 = Buffer.from(`${authToken}`, "binary").toString("base64");
470+
// converting the `authToken` string into Base64 format
471+
const encodedToken = Buffer.from(`${authToken}`, "binary").toString("base64");
471472
try {
472473
// Fetch user data from GitHub API for each document in the users collection
473474
// divided by 500 because firestore api guarantee that we can process in batch of 500.
@@ -486,7 +487,7 @@ const migrate = async (req, res) => {
486487
.get(`https://api.github.com/users/${githubUsername}`, {
487488
headers: {
488489
"Content-Type": "application/json",
489-
auth: `Bearer ${base64}`,
490+
auth: `Bearer ${encodedToken}`,
490491
},
491492
})
492493
.then((response) => {

models/users.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const addOrUpdate = async (userData, userId = null) => {
6767
throw err;
6868
}
6969
};
70+
7071
const addJoinData = async (userData) => {
7172
try {
7273
await joinModel.add(userData);
@@ -79,6 +80,7 @@ const addJoinData = async (userData) => {
7980
throw err;
8081
}
8182
};
83+
8284
const getJoinData = async (userId) => {
8385
try {
8486
const userData = [];

0 commit comments

Comments
 (0)