Edit File: config.js
const { GOOGLE_APPLICATION_CREDENTIALS,SCOPES } = require("../constVariables"), { google } = require('googleapis'), key = require(GOOGLE_APPLICATION_CREDENTIALS); class accessToken { static async getAccessToken(){ return new Promise(function(resolve, reject) { const jwtClient = new google.auth.JWT( key.client_email, null, key.private_key, SCOPES, null ); jwtClient.authorize(function(err, tokens) { if (err) { reject(err); return; } resolve(tokens.access_token); }); }); } } module.exports = accessToken;
Back to File Manager