@budibase/worker 3.12.20 → 3.12.21

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/worker",
3
3
  "email": "hi@budibase.com",
4
- "version": "3.12.20",
4
+ "version": "3.12.21",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -113,5 +113,5 @@
113
113
  }
114
114
  }
115
115
  },
116
- "gitHead": "d53386af24c8bf60595a9812b2f057afdc862bbe"
116
+ "gitHead": "bbbe8366ca8a03851165eec833adcfed130c5fb5"
117
117
  }
@@ -29,7 +29,6 @@ import {
29
29
  LockType,
30
30
  LookupAccountHolderResponse,
31
31
  LookupTenantUserResponse,
32
- PlatformUserByEmail,
33
32
  SaveUserResponse,
34
33
  SearchUsersRequest,
35
34
  SearchUsersResponse,
@@ -112,10 +111,11 @@ export const addSsoSupport = async (
112
111
  ) => {
113
112
  const { email, ssoId } = ctx.request.body
114
113
  try {
115
- // Status is changed to 404 from getUserDoc if user is not found
116
- const userByEmail = (await platform.users.getUserDoc(
117
- email
118
- )) as PlatformUserByEmail
114
+ const [userByEmail] = await users.getExistingPlatformUsers([email])
115
+ if (!userByEmail) {
116
+ ctx.throw(404, "Not Found")
117
+ }
118
+
119
119
  await platform.users.addSsoUser(
120
120
  ssoId,
121
121
  email,