0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Prefix loading successfully from config/local.json for both Homebrewery and Google brews.

Concats switched to string literals to make Linter happy.
This commit is contained in:
G.Ambatte
2021-01-29 22:53:58 +13:00
parent 051773a084
commit c3bfd1e8bf
2 changed files with 12 additions and 7 deletions

View File

@@ -258,7 +258,12 @@ GoogleActions = {
}
//Access actual file with service account. Just api key is causing "automated query" errors.
const keys = JSON.parse(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'];