0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Tweaks to work with current Master

This commit is contained in:
Trevor Buckner
2021-03-07 00:34:47 -05:00
parent 08492b943b
commit c4db94e86f
5 changed files with 29 additions and 9 deletions

View File

@@ -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'];