Init pro with the save user function

This commit is contained in:
adrinr 2023-03-13 14:25:19 +01:00
parent 21f01a53c5
commit f8396725d1
2 changed files with 14 additions and 0 deletions

View File

@ -35,6 +35,7 @@ const logger = require("koa-pino-logger")
const { userAgent } = require("koa-useragent")
import destroyable from "server-destroy"
import { initPro } from "./initPro"
// configure events to use the pro audit log write
// can't integrate directly into backend-core due to cyclic issues
@ -108,6 +109,7 @@ const shutdown = () => {
export default server.listen(parseInt(env.PORT || "4002"), async () => {
console.log(`Worker running on ${JSON.stringify(server.address())}`)
await initPro()
await redis.init()
})

View File

@ -0,0 +1,12 @@
import { sdk as proSdk } from "@budibase/pro"
import * as userSdk from "./sdk/users"
export const initPro = async () => {
await proSdk.init({
scimUserServiceConfig: {
functions: {
saveUser: userSdk.save,
},
},
})
}