Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
registrar el resultado de oauth en un archivo de hojas de Google

Tengo un código para oauth con intercom, pero me devuelve el resultado en la pantalla del usuario, quiero que

1) registrar el token en una hoja de Google 2) mostrar un mensaje de éxito al usuario y eso es todo

¿Cómo puedo modificar el código para hacer eso? ¡Realmente agradecería su ayuda!

 import oauth2, { config } from './utils/oauth' /* Function to handle intercom auth callback */ exports.handler = (event, context, callback) => { const code = event.queryStringParameters.code /* state helps mitigate CSRF attacks & Restore the previous state of your app */ const state = event.queryStringParameters.state /* Take the grant code and exchange for an accessToken */ oauth2.authorizationCode.getToken({ code: code, redirect_uri: config.redirect_uri, client_id: config.clientId, client_secret: config.clientSecret }) .then((result) => { const token = oauth2.accessToken.create(result) console.log('accessToken', token) return token }) // Get more info about intercom user .then(getUserData) // Do stuff with user data & token .then((result) => { console.log('auth token', result.token) // Do stuff with user data console.log('user data', result.data) // Do other custom stuff console.log('state', state) // return results to browser return callback(null, { statusCode: 200, body: JSON.stringify(result) }) }) .catch((error) => { console.log('Access Token Error', error.message) console.log(error) return callback(null, { statusCode: error.statusCode || 500, body: JSON.stringify({ error: error.message, }) }) }) }
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!