backend-manager 3.2.28 → 3.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "3.2.28",
3
+ "version": "3.2.30",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -266,8 +266,11 @@ Module.prototype.addToSendGridList = function (user) {
266
266
  body: {
267
267
  backendManagerKey: Manager.config.backend_manager.key,
268
268
  service: 'sendgrid',
269
- command: `/v3/marketing/contacts`,
269
+ command: `v3/marketing/contacts`,
270
270
  method: `put`,
271
+ supplemental: {
272
+ user: user,
273
+ },
271
274
  body: {
272
275
  contacts: [
273
276
  {
@@ -595,15 +595,16 @@ BackendAssistant.prototype.authenticate = async function (options) {
595
595
  self.request.user.roles.admin = true;
596
596
  return _resolve(self.request.user);
597
597
  }
598
- } else if (options.apiKey) {
599
- self.log('Found "options.apiKey"', options.apiKey, logOptions);
598
+ } else if (options.apiKey || data.apiKey) {
599
+ const apiKey = apiKey || data.apiKey;
600
+ self.log('Found "options.apiKey"', apiKey, logOptions);
600
601
 
601
- if (options.apiKey.includes('test')) {
602
+ if (apiKey.includes('test')) {
602
603
  return _resolve(self.request.user);
603
604
  }
604
605
 
605
606
  await admin.firestore().collection(`users`)
606
- .where('api.privateKey', '==', options.apiKey)
607
+ .where('api.privateKey', '==', apiKey)
607
608
  .get()
608
609
  .then(function(querySnapshot) {
609
610
  querySnapshot.forEach(function(doc) {