diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index c2c3b6f88..529c0d9ee 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -63,7 +63,7 @@ const SharePage = createClass({ source - + download diff --git a/client/homebrew/pages/userPage/brewItem/brewItem.jsx b/client/homebrew/pages/userPage/brewItem/brewItem.jsx index b0198ddc6..b24bad363 100644 --- a/client/homebrew/pages/userPage/brewItem/brewItem.jsx +++ b/client/homebrew/pages/userPage/brewItem/brewItem.jsx @@ -87,7 +87,7 @@ const BrewItem = createClass({ } return - + ; }, diff --git a/package-lock.json b/package-lock.json index 9788cc675..c4e43b468 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6592,6 +6592,14 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "sanitize-filename": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", + "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", + "requires": { + "truncate-utf8-bytes": "^1.0.0" + } + }, "saslprep": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", @@ -7333,6 +7341,14 @@ "nopt": "~1.0.10" } }, + "truncate-utf8-bytes": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", + "integrity": "sha1-QFkjkJWS1W94pYGENLC3hInKXys=", + "requires": { + "utf8-byte-length": "^1.0.1" + } + }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", @@ -7589,6 +7605,11 @@ "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" }, + "utf8-byte-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", + "integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=" + }, "util": { "version": "0.10.4", "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", diff --git a/server.js b/server.js index d14514f32..96d5d677f 100644 --- a/server.js +++ b/server.js @@ -1,4 +1,4 @@ -/*eslint max-lines: ["warn", {"max": 250, "skipBlankLines": true, "skipComments": true}]*/ +/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/ const _ = require('lodash'); const jwt = require('jwt-simple'); const express = require('express'); diff --git a/server/googleActions.js b/server/googleActions.js index 802ac3343..bd288ceea 100644 --- a/server/googleActions.js +++ b/server/googleActions.js @@ -259,13 +259,12 @@ GoogleActions = { throw ('Share ID does not match'); } - //Access actual file with service account. Just api key is causing "automated query" errors. + //Access file using service account. Using API key only causes "automated query" lockouts after a while. + + const keys = typeof(config.get('service_account')) == 'string' ? + JSON.parse(config.get('service_account')) : + config.get('service_account'); - const actionList = { - 'string' : function() { return JSON.parse(config.get('service_account')); }, - 'object' : function() { return config.get('service_account'); } - }; - const keys = actionList[typeof(config.get('service_account'))](); const serviceAuth = google.auth.fromJSON(keys); serviceAuth.scopes = ['https://www.googleapis.com/auth/drive'];