Init pro with the save user function
This commit is contained in:
parent
21f01a53c5
commit
f8396725d1
|
@ -35,6 +35,7 @@ const logger = require("koa-pino-logger")
|
||||||
const { userAgent } = require("koa-useragent")
|
const { userAgent } = require("koa-useragent")
|
||||||
|
|
||||||
import destroyable from "server-destroy"
|
import destroyable from "server-destroy"
|
||||||
|
import { initPro } from "./initPro"
|
||||||
|
|
||||||
// configure events to use the pro audit log write
|
// configure events to use the pro audit log write
|
||||||
// can't integrate directly into backend-core due to cyclic issues
|
// 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 () => {
|
export default server.listen(parseInt(env.PORT || "4002"), async () => {
|
||||||
console.log(`Worker running on ${JSON.stringify(server.address())}`)
|
console.log(`Worker running on ${JSON.stringify(server.address())}`)
|
||||||
|
await initPro()
|
||||||
await redis.init()
|
await redis.init()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
Loading…
Reference in New Issue