backend-manager 3.0.47 → 3.0.48

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.0.47",
3
+ "version": "3.0.48",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -1,4 +1,4 @@
1
- const { get } = require('lodash');
1
+ const { get, merge } = require('lodash');
2
2
 
3
3
  function Module() {
4
4
  const self = this;
@@ -37,22 +37,17 @@ Module.prototype.main = function () {
37
37
  assistant.error(`Failed to get existing user ${user.uid}:`, existingUser, { environment: 'production' });
38
38
 
39
39
  return reject(existingUser);
40
- } else if (
41
- get(existingUser, 'auth.uid', null)
42
- || get(existingUser, 'auth.email', null)
43
- ) {
44
- assistant.log(`Skipping handler because user already exists ${user.uid}:`, existingUser);
45
-
46
- return resolve(self);
47
40
  }
48
41
 
49
42
  // Build user object
50
- const newUser = self.Manager.User({
43
+ let newUser = self.Manager.User().properties;
44
+
45
+ newUser = merge(newUser, existingUser, {
51
46
  auth: {
52
47
  uid: user.uid,
53
48
  email: user.email,
54
- }
55
- }).properties;
49
+ },
50
+ });
56
51
 
57
52
  // Set up analytics
58
53
  const analytics = self.Manager.Analytics({