File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -467,7 +467,8 @@ const filterUsers = async (req, res) => {
467
467
// one time script function to perform the migration - adding github_user_id field to the document
468
468
const migrate = async ( req , res ) => {
469
469
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" ) ;
471
472
try {
472
473
// Fetch user data from GitHub API for each document in the users collection
473
474
// divided by 500 because firestore api guarantee that we can process in batch of 500.
@@ -486,7 +487,7 @@ const migrate = async (req, res) => {
486
487
. get ( `https://api.github.com/users/${ githubUsername } ` , {
487
488
headers : {
488
489
"Content-Type" : "application/json" ,
489
- auth : `Bearer ${ base64 } ` ,
490
+ auth : `Bearer ${ encodedToken } ` ,
490
491
} ,
491
492
} )
492
493
. then ( ( response ) => {
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ const addOrUpdate = async (userData, userId = null) => {
67
67
throw err ;
68
68
}
69
69
} ;
70
+
70
71
const addJoinData = async ( userData ) => {
71
72
try {
72
73
await joinModel . add ( userData ) ;
@@ -79,6 +80,7 @@ const addJoinData = async (userData) => {
79
80
throw err ;
80
81
}
81
82
} ;
83
+
82
84
const getJoinData = async ( userId ) => {
83
85
try {
84
86
const userData = [ ] ;
You can’t perform that action at this time.
0 commit comments