@@ -6,13 +6,13 @@ const { updateMeetingGoogleInfo } = require('../../../modules/meeting/helpers')
66
77const TOKEN_PATH = `${ __dirname } /token.json`
88const install = {
9- client_id : "752565208443-0g0ui7afokfi2b1t1von4qankq1vh62h.apps.googleusercontent.com" , //"758477701769-hasb17jt161beprjr34kgqjma0sb815h.apps.googleusercontent.com",//global.gConfig.GOOGLE_CLIENT_ID,
10- project_id : "prod-calendar-386407" , //"junction-calendar-375014",//global.gConfig.GOOGLE_PROJECT_ID,
11- auth_uri : "https://accounts.google.com/o/oauth2/auth" , //"https://accounts.google.com/o/oauth2/auth", //global.gConfig.GOOGLE_AUTH_URI,
12- token_uri : "https://oauth2.googleapis.com/token" , //"https://oauth2.googleapis.com/token", //global.gConfig.GOOGLE_TOKEN_URI,
13- auth_provider_x509_cert_url : "https://www.googleapis.com/oauth2/v1/certs" , //"https://www.googleapis.com/oauth2/v1/certs", //global.gConfig.GOOGLE_AUTH_PROVIDER,
14- client_secret : "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" , //"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", //global.gConfig.GOOGLE_CLIENT_SECRET,
15- redirect_uris :[ "http://localhost" , "https://app.hackjunction.com" , "https://eu.junctionplatform.com" ] //["http://localhost","https://app.hackjunction.com"], //[ global.gConfig.GOOGLE_REDIRECT]
9+ client_id : "752565208443-0g0ui7afokfi2b1t1von4qankq1vh62h.apps.googleusercontent.com" , //"758477701769-hasb17jt161beprjr34kgqjma0sb815h.apps.googleusercontent.com",//global.gConfig.GOOGLE_CLIENT_ID,
10+ project_id : "prod-calendar-386407" , //"junction-calendar-375014",//global.gConfig.GOOGLE_PROJECT_ID,
11+ auth_uri : "https://accounts.google.com/o/oauth2/auth" , //"https://accounts.google.com/o/oauth2/auth", //global.gConfig.GOOGLE_AUTH_URI,
12+ token_uri : "https://oauth2.googleapis.com/token" , //"https://oauth2.googleapis.com/token", //global.gConfig.GOOGLE_TOKEN_URI,
13+ auth_provider_x509_cert_url : "https://www.googleapis.com/oauth2/v1/certs" , //"https://www.googleapis.com/oauth2/v1/certs", //global.gConfig.GOOGLE_AUTH_PROVIDER,
14+ client_secret : "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" , //"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", //global.gConfig.GOOGLE_CLIENT_SECRET,
15+ redirect_uris : [ "http://localhost" , "https://app.hackjunction.com" , "https://eu.junctionplatform.com" ] //["http://localhost","https://app.hackjunction.com"], //[ global.gConfig.GOOGLE_REDIRECT]
1616}
1717const credentialsJ = {
1818 installed : install
@@ -39,9 +39,9 @@ function authorize(credentials, callback, callbackParameter = null) {
3939 console . log ( 'Error loading google calendar token file' )
4040 return false
4141 }
42- console . log ( "got token" , token )
42+
4343 oAuth2Client . setCredentials ( JSON . parse ( token ) )
44- console . log ( "oAuth2Client, callbackParameter" , callback ( oAuth2Client , callbackParameter ) )
44+
4545 callback ( oAuth2Client , callbackParameter )
4646 } )
4747
@@ -60,7 +60,7 @@ function authorize(credentials, callback, callbackParameter = null) {
6060}
6161
6262const insertEvent = ( auth , eventInfo ) => {
63- console . log ( "inserting" )
63+
6464 const calendar = google . calendar ( { version : 'v3' , auth } )
6565 calendar . events . insert (
6666 {
@@ -76,7 +76,6 @@ const insertEvent = (auth, eventInfo) => {
7676 )
7777 // cancelMeeting(eventInfo.meetingId)
7878 } else {
79- console . log ( res )
8079 updateMeetingGoogleInfo (
8180 eventInfo . meetingId ,
8281 res . data . id ,
@@ -116,7 +115,7 @@ const deleteGoogleEvent = eventId => {
116115 return true
117116 })*/
118117
119- authorize ( JSON . parse ( JSON . stringify ( credentialsJ ) ) , deleteEvent , eventId )
118+ authorize ( JSON . parse ( JSON . stringify ( credentialsJ ) ) , deleteEvent , eventId )
120119 return true
121120
122121 } catch ( err ) {
@@ -167,8 +166,7 @@ const createGoogleEvent = event => {
167166
168167 })*/
169168
170- console . log ( credentialsJ )
171- authorize ( JSON . parse ( JSON . stringify ( credentialsJ ) ) , insertEvent , eventInfo )
169+ authorize ( JSON . parse ( JSON . stringify ( credentialsJ ) ) , insertEvent , eventInfo )
172170 console . log ( "success" )
173171 return true
174172 } catch ( err ) {
0 commit comments