backend-manager 3.0.60 → 3.0.61

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.60",
3
+ "version": "3.0.61",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -15,6 +15,8 @@ Module.prototype.main = function () {
15
15
  return new Promise(async function(resolve, reject) {
16
16
  Api.resolveUser({adminRequired: true})
17
17
  .then(async (user) => {
18
+ const uid = user?.auth?.uid;
19
+
18
20
  // Disallow deleting users with subscriptions in any state other than cancelled or active payments
19
21
  if (
20
22
  (user?.plan?.status && user?.plan?.status !== 'cancelled')
@@ -35,7 +37,7 @@ Module.prototype.main = function () {
35
37
  backendManagerKey: self.Manager.config.backend_manager.key,
36
38
  command: 'user:sign-out-all-sessions',
37
39
  payload: {
38
- uid: user.uid,
40
+ uid: uid,
39
41
  }
40
42
  },
41
43
  })
@@ -47,7 +49,7 @@ Module.prototype.main = function () {
47
49
  })
48
50
 
49
51
  // Perform the delete
50
- await self.libraries.admin.auth().deleteUser(_.get(user, 'auth.uid', null))
52
+ await self.libraries.admin.auth().deleteUser(uid)
51
53
  .then(() => {
52
54
  return resolve({data: {success: true}});
53
55
  })