@budibase/worker 2.29.25 → 2.29.27

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": "2.29.25",
4
+ "version": "2.29.27",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -37,10 +37,10 @@
37
37
  "author": "Budibase",
38
38
  "license": "GPL-3.0",
39
39
  "dependencies": {
40
- "@budibase/backend-core": "2.29.25",
41
- "@budibase/pro": "2.29.25",
42
- "@budibase/string-templates": "2.29.25",
43
- "@budibase/types": "2.29.25",
40
+ "@budibase/backend-core": "2.29.27",
41
+ "@budibase/pro": "2.29.27",
42
+ "@budibase/string-templates": "2.29.27",
43
+ "@budibase/types": "2.29.27",
44
44
  "@koa/router": "8.0.8",
45
45
  "@techpass/passport-openidconnect": "0.3.3",
46
46
  "@types/global-agent": "2.1.1",
@@ -107,5 +107,5 @@
107
107
  }
108
108
  }
109
109
  },
110
- "gitHead": "37355491d0c91b5b9e0826e77a2265f27dba33f8"
110
+ "gitHead": "c48b7781cd815f3c5c2c73ce4d195855f0508fe5"
111
111
  }
@@ -62,7 +62,7 @@ export const addSsoSupport = async (ctx: Ctx<AddSSoUserRequest>) => {
62
62
  const { email, ssoId } = ctx.request.body
63
63
  try {
64
64
  // Status is changed to 404 from getUserDoc if user is not found
65
- let userByEmail = (await platform.users.getUserDoc(
65
+ const userByEmail = (await platform.users.getUserDoc(
66
66
  email
67
67
  )) as PlatformUserByEmail
68
68
  await platform.users.addSsoUser(
@@ -71,6 +71,13 @@ export const addSsoSupport = async (ctx: Ctx<AddSSoUserRequest>) => {
71
71
  userByEmail.userId,
72
72
  userByEmail.tenantId
73
73
  )
74
+ // Need to get the _rev of the user doc to update
75
+ const userById = await platform.users.getUserDoc(userByEmail.userId)
76
+ await platform.users.updateUserDoc({
77
+ ...userById,
78
+ email,
79
+ ssoId,
80
+ })
74
81
  ctx.status = 200
75
82
  } catch (err: any) {
76
83
  ctx.throw(err.status || 400, err)
@@ -268,7 +275,7 @@ export const find = async (ctx: any) => {
268
275
 
269
276
  export const tenantUserLookup = async (ctx: any) => {
270
277
  const id = ctx.params.id
271
- const user = await userSdk.core.getPlatformUser(id)
278
+ const user = await userSdk.core.getFirstPlatformUser(id)
272
279
  if (user) {
273
280
  ctx.body = user
274
281
  } else {