Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-authorize

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-authorize - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

30

index.js

@@ -14,7 +14,10 @@ const fs = require('fs');

* Default constructor
* @param {array} scopes An array representing the scopes
* @param {Array} scopes An array representing the scopes
* to authorize for the oauth2Client. Example ['spreadsheets'] would
* correlate with ..googleapis.com/auth/spreadsheets.
* @param {String} credentialsPath Where your Google credentials.json lives.
* Defaults to 'credentials.json' which is relative to your execution
* context.
*/
constructor(scopes) {
constructor(scopes, credentialsPath) {
// If modifying these scopes, delete your previously saved credentials

@@ -35,2 +38,3 @@ // at ~/.credentials/credentials.json

this.TOKEN_PATH = this.TOKEN_DIR + 'googleapis.json';
this.credentialsPath = credentialsPath || 'credentials.json';
}

@@ -47,13 +51,13 @@ /**

// Load client secrets from a local file.
fs.readFile('credentials.json',
function processClientSecrets(err, content) {
if (err) {
console.error('Error loading credentials.json file: ' + err);
reject(err);
return;
}
// Authorize a client with the loaded credentials, then call the
// Google Sheets API.
resolve(this._authorize(JSON.parse(content)));
}.bind(this));
fs.readFile(this.credentialsPath,
function processClientSecrets(err, content) {
if (err) {
console.error('Error loading credentials.json file: ' + err);
reject(err);
return;
}
// Authorize a client with the loaded credentials, then call the
// Google Sheets API.
resolve(this._authorize(JSON.parse(content)));
}.bind(this));
});

@@ -60,0 +64,0 @@ }

{
"name": "google-authorize",
"version": "1.0.3",
"version": "1.0.4",
"description": "Get an OAuth2 client with authorized token to be used with Google APIs.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc