2022-11-23 19:25:20 +01:00
|
|
|
import * as email from "../../../utilities/email"
|
|
|
|
import env from "../../../environment"
|
|
|
|
import { googleCallbackUrl, oidcCallbackUrl } from "./auth"
|
|
|
|
import {
|
2022-06-29 14:08:48 +02:00
|
|
|
cache,
|
2023-02-23 14:41:35 +01:00
|
|
|
configs,
|
2022-11-23 19:25:20 +01:00
|
|
|
db as dbCore,
|
2022-12-15 12:35:22 +01:00
|
|
|
env as coreEnv,
|
2023-02-23 14:41:35 +01:00
|
|
|
events,
|
|
|
|
objectStore,
|
|
|
|
tenancy,
|
2022-11-23 19:25:20 +01:00
|
|
|
} from "@budibase/backend-core"
|
|
|
|
import { checkAnyUserExists } from "../../../utilities/users"
|
|
|
|
import {
|
2023-02-23 14:41:35 +01:00
|
|
|
Config,
|
2022-11-23 19:25:20 +01:00
|
|
|
ConfigType,
|
2023-02-23 14:41:35 +01:00
|
|
|
Ctx,
|
|
|
|
GetPublicOIDCConfigResponse,
|
|
|
|
GetPublicSettingsResponse,
|
2022-12-15 12:35:22 +01:00
|
|
|
isGoogleConfig,
|
|
|
|
isOIDCConfig,
|
|
|
|
isSettingsConfig,
|
|
|
|
isSMTPConfig,
|
|
|
|
UserCtx,
|
2022-11-23 19:25:20 +01:00
|
|
|
} from "@budibase/types"
|
2023-02-27 14:42:51 +01:00
|
|
|
import * as pro from "@budibase/pro"
|
2022-11-23 19:25:20 +01:00
|
|
|
|
2023-02-23 14:41:35 +01:00
|
|
|
const getEventFns = async (config: Config, existing?: Config) => {
|
2022-04-06 00:14:53 +02:00
|
|
|
const fns = []
|
2022-04-05 17:56:28 +02:00
|
|
|
|
2022-04-06 00:14:53 +02:00
|
|
|
if (!existing) {
|
2022-12-15 12:35:22 +01:00
|
|
|
if (isSMTPConfig(config)) {
|
|
|
|
fns.push(events.email.SMTPCreated)
|
|
|
|
} else if (isGoogleConfig(config)) {
|
|
|
|
fns.push(() => events.auth.SSOCreated(ConfigType.GOOGLE))
|
|
|
|
if (config.config.activated) {
|
|
|
|
fns.push(() => events.auth.SSOActivated(ConfigType.GOOGLE))
|
2022-04-06 23:53:33 +02:00
|
|
|
}
|
2022-12-15 12:35:22 +01:00
|
|
|
} else if (isOIDCConfig(config)) {
|
|
|
|
fns.push(() => events.auth.SSOCreated(ConfigType.OIDC))
|
|
|
|
if (config.config.configs[0].activated) {
|
|
|
|
fns.push(() => events.auth.SSOActivated(ConfigType.OIDC))
|
2022-04-06 23:53:33 +02:00
|
|
|
}
|
2022-12-15 12:35:22 +01:00
|
|
|
} else if (isSettingsConfig(config)) {
|
|
|
|
// company
|
|
|
|
const company = config.config.company
|
|
|
|
if (company && company !== "Budibase") {
|
|
|
|
fns.push(events.org.nameUpdated)
|
2022-04-06 23:53:33 +02:00
|
|
|
}
|
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
// logo
|
|
|
|
const logoUrl = config.config.logoUrl
|
|
|
|
if (logoUrl) {
|
|
|
|
fns.push(events.org.logoUpdated)
|
|
|
|
}
|
2022-04-06 23:53:33 +02:00
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
// platform url
|
|
|
|
const platformUrl = config.config.platformUrl
|
|
|
|
if (
|
|
|
|
platformUrl &&
|
|
|
|
platformUrl !== "http://localhost:10000" &&
|
|
|
|
env.SELF_HOSTED
|
|
|
|
) {
|
|
|
|
fns.push(events.org.platformURLUpdated)
|
2022-04-06 23:53:33 +02:00
|
|
|
}
|
2022-04-06 00:14:53 +02:00
|
|
|
}
|
|
|
|
} else {
|
2022-12-15 12:35:22 +01:00
|
|
|
if (isSMTPConfig(config)) {
|
|
|
|
fns.push(events.email.SMTPUpdated)
|
|
|
|
} else if (isGoogleConfig(config)) {
|
|
|
|
fns.push(() => events.auth.SSOUpdated(ConfigType.GOOGLE))
|
|
|
|
if (!existing.config.activated && config.config.activated) {
|
|
|
|
fns.push(() => events.auth.SSOActivated(ConfigType.GOOGLE))
|
|
|
|
} else if (existing.config.activated && !config.config.activated) {
|
|
|
|
fns.push(() => events.auth.SSODeactivated(ConfigType.GOOGLE))
|
2022-04-06 23:53:33 +02:00
|
|
|
}
|
2022-12-15 12:35:22 +01:00
|
|
|
} else if (isOIDCConfig(config)) {
|
|
|
|
fns.push(() => events.auth.SSOUpdated(ConfigType.OIDC))
|
|
|
|
if (
|
|
|
|
!existing.config.configs[0].activated &&
|
|
|
|
config.config.configs[0].activated
|
|
|
|
) {
|
|
|
|
fns.push(() => events.auth.SSOActivated(ConfigType.OIDC))
|
|
|
|
} else if (
|
|
|
|
existing.config.configs[0].activated &&
|
|
|
|
!config.config.configs[0].activated
|
|
|
|
) {
|
|
|
|
fns.push(() => events.auth.SSODeactivated(ConfigType.OIDC))
|
2022-04-06 23:53:33 +02:00
|
|
|
}
|
2022-12-15 12:35:22 +01:00
|
|
|
} else if (isSettingsConfig(config)) {
|
|
|
|
// company
|
|
|
|
const existingCompany = existing.config.company
|
|
|
|
const company = config.config.company
|
|
|
|
if (company && company !== "Budibase" && existingCompany !== company) {
|
|
|
|
fns.push(events.org.nameUpdated)
|
2022-04-06 23:53:33 +02:00
|
|
|
}
|
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
// logo
|
|
|
|
const existingLogoUrl = existing.config.logoUrl
|
|
|
|
const logoUrl = config.config.logoUrl
|
|
|
|
if (logoUrl && existingLogoUrl !== logoUrl) {
|
|
|
|
fns.push(events.org.logoUpdated)
|
|
|
|
}
|
2022-04-06 23:53:33 +02:00
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
// platform url
|
|
|
|
const existingPlatformUrl = existing.config.platformUrl
|
|
|
|
const platformUrl = config.config.platformUrl
|
|
|
|
if (
|
|
|
|
platformUrl &&
|
|
|
|
platformUrl !== "http://localhost:10000" &&
|
|
|
|
existingPlatformUrl !== platformUrl &&
|
|
|
|
env.SELF_HOSTED
|
|
|
|
) {
|
|
|
|
fns.push(events.org.platformURLUpdated)
|
2022-04-06 23:53:33 +02:00
|
|
|
}
|
2022-04-06 00:14:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return fns
|
|
|
|
}
|
2022-04-05 17:56:28 +02:00
|
|
|
|
2023-02-23 14:41:35 +01:00
|
|
|
export async function save(ctx: UserCtx<Config>) {
|
|
|
|
const body = ctx.request.body
|
|
|
|
const type = body.type
|
|
|
|
const config = body.config
|
|
|
|
|
|
|
|
const existingConfig = await configs.getConfig(type)
|
|
|
|
let eventFns = await getEventFns(ctx.request.body, existingConfig)
|
|
|
|
|
2023-02-27 14:42:51 +01:00
|
|
|
if (existingConfig) {
|
|
|
|
body._rev = existingConfig._rev
|
2021-04-20 19:14:36 +02:00
|
|
|
}
|
2023-02-27 14:42:51 +01:00
|
|
|
|
2021-06-09 16:45:54 +02:00
|
|
|
try {
|
|
|
|
// verify the configuration
|
2023-02-23 14:41:35 +01:00
|
|
|
switch (config.type) {
|
2022-11-23 19:25:20 +01:00
|
|
|
case ConfigType.SMTP:
|
2021-06-09 16:45:54 +02:00
|
|
|
await email.verifyConfig(config)
|
|
|
|
break
|
|
|
|
}
|
2022-11-23 19:25:20 +01:00
|
|
|
} catch (err: any) {
|
2021-06-09 16:45:54 +02:00
|
|
|
ctx.throw(400, err)
|
2021-04-23 14:49:47 +02:00
|
|
|
}
|
|
|
|
|
2021-04-20 19:14:36 +02:00
|
|
|
try {
|
2023-02-27 14:42:51 +01:00
|
|
|
body._id = configs.generateConfigID(type)
|
2023-02-23 14:41:35 +01:00
|
|
|
const response = await configs.save(body)
|
2022-11-24 19:48:51 +01:00
|
|
|
await cache.bustCache(cache.CacheKey.CHECKLIST)
|
|
|
|
await cache.bustCache(cache.CacheKey.ANALYTICS_ENABLED)
|
2022-05-29 00:03:31 +02:00
|
|
|
|
2022-04-06 00:14:53 +02:00
|
|
|
for (const fn of eventFns) {
|
2022-05-23 23:14:44 +02:00
|
|
|
await fn()
|
2022-04-06 00:14:53 +02:00
|
|
|
}
|
2022-05-29 00:03:31 +02:00
|
|
|
|
2021-04-20 19:14:36 +02:00
|
|
|
ctx.body = {
|
2021-04-22 12:45:22 +02:00
|
|
|
type,
|
2021-04-20 19:14:36 +02:00
|
|
|
_id: response.id,
|
|
|
|
_rev: response.rev,
|
|
|
|
}
|
2022-11-23 19:25:20 +01:00
|
|
|
} catch (err: any) {
|
2021-06-09 16:45:54 +02:00
|
|
|
ctx.throw(400, err)
|
2021-04-20 19:14:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
export async function find(ctx: UserCtx) {
|
2021-04-20 19:14:36 +02:00
|
|
|
try {
|
2021-04-22 12:45:22 +02:00
|
|
|
// Find the config with the most granular scope based on context
|
2023-02-23 14:41:35 +01:00
|
|
|
const type = ctx.params.type
|
|
|
|
const scopedConfig = await configs.getConfig(type)
|
2021-04-22 12:45:22 +02:00
|
|
|
|
|
|
|
if (scopedConfig) {
|
|
|
|
ctx.body = scopedConfig
|
|
|
|
} else {
|
2021-06-21 18:13:06 +02:00
|
|
|
// don't throw an error, there simply is nothing to return
|
|
|
|
ctx.body = {}
|
2021-04-22 12:45:22 +02:00
|
|
|
}
|
2022-11-23 19:25:20 +01:00
|
|
|
} catch (err: any) {
|
|
|
|
ctx.throw(err?.status || 400, err)
|
2021-04-20 19:14:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-23 14:41:35 +01:00
|
|
|
export async function publicOidc(ctx: Ctx<void, GetPublicOIDCConfigResponse>) {
|
2021-07-13 15:54:20 +02:00
|
|
|
try {
|
|
|
|
// Find the config with the most granular scope based on context
|
2023-02-23 14:41:35 +01:00
|
|
|
const config = await configs.getOIDCConfig()
|
2021-07-13 15:54:20 +02:00
|
|
|
|
2023-02-23 14:41:35 +01:00
|
|
|
if (!config) {
|
|
|
|
ctx.body = []
|
2021-07-13 15:54:20 +02:00
|
|
|
} else {
|
2023-02-23 14:41:35 +01:00
|
|
|
ctx.body = [
|
|
|
|
{
|
|
|
|
logo: config.logo,
|
|
|
|
name: config.name,
|
|
|
|
uuid: config.uuid,
|
|
|
|
},
|
|
|
|
]
|
2021-07-13 15:54:20 +02:00
|
|
|
}
|
2022-11-23 19:25:20 +01:00
|
|
|
} catch (err: any) {
|
2021-07-13 15:54:20 +02:00
|
|
|
ctx.throw(err.status, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-23 14:41:35 +01:00
|
|
|
export async function publicSettings(
|
|
|
|
ctx: Ctx<void, GetPublicSettingsResponse>
|
|
|
|
) {
|
2021-06-21 19:01:25 +02:00
|
|
|
try {
|
2023-02-23 14:41:35 +01:00
|
|
|
// settings
|
2023-02-27 14:42:51 +01:00
|
|
|
const configDoc = await configs.getSettingsConfigDoc()
|
|
|
|
const config = configDoc.config
|
2023-02-23 14:41:35 +01:00
|
|
|
// enrich the logo url - empty url means deleted
|
|
|
|
if (config.logoUrl && config.logoUrl !== "") {
|
|
|
|
config.logoUrl = objectStore.getGlobalFileUrl(
|
2022-12-15 12:35:22 +01:00
|
|
|
"settings",
|
|
|
|
"logoUrl",
|
2023-02-23 14:41:35 +01:00
|
|
|
config.logoUrlEtag
|
2022-12-15 12:35:22 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2023-02-23 14:41:35 +01:00
|
|
|
// google
|
|
|
|
const googleConfig = await configs.getGoogleConfig()
|
|
|
|
const preActivated = googleConfig?.activated == null
|
|
|
|
const google = preActivated || !!googleConfig?.activated
|
|
|
|
const _googleCallbackUrl = await googleCallbackUrl(googleConfig)
|
2021-07-23 12:38:17 +02:00
|
|
|
|
2023-02-23 14:41:35 +01:00
|
|
|
// oidc
|
|
|
|
const oidcConfig = await configs.getOIDCConfig()
|
|
|
|
const oidc = oidcConfig?.activated || false
|
|
|
|
const _oidcCallbackUrl = await oidcCallbackUrl()
|
2021-11-12 14:31:55 +01:00
|
|
|
|
2023-02-27 14:42:51 +01:00
|
|
|
// sso enforced
|
|
|
|
const isSSOEnforced = await pro.features.isSSOEnforced({ config })
|
|
|
|
|
2023-02-23 14:41:35 +01:00
|
|
|
ctx.body = {
|
|
|
|
type: ConfigType.SETTINGS,
|
2023-02-27 14:42:51 +01:00
|
|
|
_id: configDoc._id,
|
|
|
|
_rev: configDoc._rev,
|
2023-02-23 14:41:35 +01:00
|
|
|
config: {
|
|
|
|
...config,
|
|
|
|
google,
|
|
|
|
oidc,
|
2023-02-27 14:42:51 +01:00
|
|
|
isSSOEnforced,
|
2023-02-23 14:41:35 +01:00
|
|
|
oidcCallbackUrl: _oidcCallbackUrl,
|
|
|
|
googleCallbackUrl: _googleCallbackUrl,
|
|
|
|
},
|
2021-07-23 15:40:22 +02:00
|
|
|
}
|
2022-11-23 19:25:20 +01:00
|
|
|
} catch (err: any) {
|
2021-06-21 19:01:25 +02:00
|
|
|
ctx.throw(err.status, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
export async function upload(ctx: UserCtx) {
|
|
|
|
if (ctx.request.files == null || Array.isArray(ctx.request.files.file)) {
|
2021-05-07 14:55:30 +02:00
|
|
|
ctx.throw(400, "One file must be uploaded.")
|
|
|
|
}
|
fixes for google sheets, admin checklist, and deleting an app from API (#8846)
* fixes for google sheets, admin checklist, and deleting an app from API
* code review
* splitting unpublish endpoint, moving deploy endpoint to applications controller. Still to do public API work and move deployment controller into application controller
* updating REST method for unpublish in API test
* unpublish and publish endpoint on public API, delete endpoint unpublishes and deletes app
* removing skip_setup from prodAppDb call
* removing commented code
* unit tests and open API spec updates
* unpublish, publish unit tests - delete still in progress
* remove line updating app name in API test
* unit tests
* v2.1.46
* Update pro version to 2.1.46
* v2.2.0
* Update pro version to 2.2.0
* Fix for budibase plugin skeleton, which utilises the old import style.
* Fix side nav styles
* v2.2.1
* Update pro version to 2.2.1
* using dist folder to allow importing constants for openAPI specs
* v2.2.2
* Update pro version to 2.2.2
* Fix for user enrichment call (updating to @budibase/nano fork) (#9038)
* Fix for #9029 - this should fix the issue users have been experiencing with user enrichment calls in apps, essentially it utilises a fork of the nano library we use to interact with CouchDB, which has been updated to use a POST request rather than a GET request as it supports a larger set of data being sent as query parameters.
* Incrementing Nano version to attempt to fix yarn registry issues.
* v2.2.3
* Update pro version to 2.2.3
* Fix SQL table `_id` filtering (#9030)
* Re-add support for filtering on _id using external SQL tables and fix filter key prefixes not working with _id field
* Remove like operator from internal tables and only allow basic operators on SQL table _id column
* Update data section filtering to respect new rules
* Update automation section filtering to respect new rules
* Update dynamic filter component to respect new rules
* v2.2.4
* Update pro version to 2.2.4
* lock changes (#9047)
* v2.2.5
* Update pro version to 2.2.5
* Make looping arrow point in right direction (#9053)
* v2.2.6
* Update pro version to 2.2.6
* Types/attaching license to account (#9065)
* adding license type to account
* removing planDuration
* v2.2.7
* Update pro version to 2.2.7
* Environment variable type coercion fix (#9074)
* Environment variable type coercion fix
* Update .gitignore
* v2.2.8
* Update pro version to 2.2.8
* tests passing
* all tests passing, updates to public API response
* update unpublish call to return 204, openAPI spec and unit
* fixing API tests
Co-authored-by: Budibase Release Bot <>
Co-authored-by: mike12345567 <me@michaeldrury.co.uk>
Co-authored-by: Andrew Kingston <andrew@kingston.dev>
Co-authored-by: melohagan <101575380+melohagan@users.noreply.github.com>
Co-authored-by: Rory Powell <rory.codes@gmail.com>
2022-12-19 14:18:00 +01:00
|
|
|
const file = ctx.request.files.file as any
|
2021-05-07 14:55:30 +02:00
|
|
|
const { type, name } = ctx.params
|
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
let bucket = coreEnv.GLOBAL_BUCKET_NAME
|
|
|
|
const key = objectStore.getGlobalFileS3Key(type, name)
|
2021-11-12 14:31:55 +01:00
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
const result = await objectStore.upload({
|
2021-05-07 14:55:30 +02:00
|
|
|
bucket,
|
|
|
|
filename: key,
|
|
|
|
path: file.path,
|
|
|
|
type: file.type,
|
|
|
|
})
|
|
|
|
|
|
|
|
// add to configuration structure
|
2023-02-23 14:41:35 +01:00
|
|
|
let config = await configs.getConfig(type)
|
|
|
|
if (!config) {
|
|
|
|
config = {
|
|
|
|
_id: configs.generateConfigID(type),
|
|
|
|
type,
|
2021-05-12 15:27:33 +02:00
|
|
|
config: {},
|
2021-05-07 14:55:30 +02:00
|
|
|
}
|
|
|
|
}
|
2022-12-15 12:35:22 +01:00
|
|
|
|
|
|
|
// save the Etag for cache bursting
|
|
|
|
const etag = result.ETag
|
|
|
|
if (etag) {
|
2023-02-23 14:41:35 +01:00
|
|
|
config.config[`${name}Etag`] = etag.replace(/"/g, "")
|
2021-11-12 14:31:55 +01:00
|
|
|
}
|
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
// save the file key
|
2023-02-23 14:41:35 +01:00
|
|
|
config.config[`${name}`] = key
|
2022-12-15 12:35:22 +01:00
|
|
|
|
|
|
|
// write back to db
|
2023-02-23 14:41:35 +01:00
|
|
|
await configs.save(config)
|
2021-05-07 14:55:30 +02:00
|
|
|
|
|
|
|
ctx.body = {
|
|
|
|
message: "File has been uploaded and url stored to config.",
|
2022-12-15 12:35:22 +01:00
|
|
|
url: objectStore.getGlobalFileUrl(type, name, etag),
|
2021-05-07 14:55:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
export async function destroy(ctx: UserCtx) {
|
2022-11-23 19:25:20 +01:00
|
|
|
const db = tenancy.getGlobalDB()
|
2021-04-20 19:14:36 +02:00
|
|
|
const { id, rev } = ctx.params
|
|
|
|
try {
|
|
|
|
await db.remove(id, rev)
|
2022-11-26 15:46:01 +01:00
|
|
|
await cache.destroy(cache.CacheKey.CHECKLIST)
|
2021-04-20 19:14:36 +02:00
|
|
|
ctx.body = { message: "Config deleted successfully" }
|
2022-11-23 19:25:20 +01:00
|
|
|
} catch (err: any) {
|
2021-04-20 19:14:36 +02:00
|
|
|
ctx.throw(err.status, err)
|
|
|
|
}
|
|
|
|
}
|
2021-05-05 21:58:31 +02:00
|
|
|
|
2022-12-15 12:35:22 +01:00
|
|
|
export async function configChecklist(ctx: Ctx) {
|
2022-11-23 19:25:20 +01:00
|
|
|
const tenantId = tenancy.getTenantId()
|
2021-05-05 21:58:31 +02:00
|
|
|
|
|
|
|
try {
|
2022-11-23 19:25:20 +01:00
|
|
|
ctx.body = await cache.withCache(
|
2022-11-24 19:48:51 +01:00
|
|
|
cache.CacheKey.CHECKLIST,
|
2022-05-23 17:57:15 +02:00
|
|
|
env.CHECKLIST_CACHE_TTL,
|
|
|
|
async () => {
|
|
|
|
let apps = []
|
|
|
|
if (!env.MULTI_TENANCY || tenantId) {
|
|
|
|
// Apps exist
|
2022-11-23 19:25:20 +01:00
|
|
|
apps = await dbCore.getAllApps({ idsOnly: true, efficient: true })
|
2022-05-23 17:57:15 +02:00
|
|
|
}
|
2021-05-21 15:55:11 +02:00
|
|
|
|
2022-05-23 17:57:15 +02:00
|
|
|
// They have set up SMTP
|
2023-02-23 14:41:35 +01:00
|
|
|
const smtpConfig = await configs.getSMTPConfig()
|
2022-05-23 17:57:15 +02:00
|
|
|
|
|
|
|
// They have set up Google Auth
|
2023-02-23 14:41:35 +01:00
|
|
|
const googleConfig = await configs.getGoogleConfig()
|
2022-05-23 01:09:03 +02:00
|
|
|
|
2022-05-23 17:57:15 +02:00
|
|
|
// They have set up OIDC
|
2023-02-23 14:41:35 +01:00
|
|
|
const oidcConfig = await configs.getOIDCConfig()
|
2022-05-23 17:57:15 +02:00
|
|
|
|
2022-11-23 19:25:20 +01:00
|
|
|
// They have set up a global user
|
2022-06-30 13:01:15 +02:00
|
|
|
const userExists = await checkAnyUserExists()
|
2022-05-23 17:57:15 +02:00
|
|
|
return {
|
|
|
|
apps: {
|
|
|
|
checked: apps.length > 0,
|
|
|
|
label: "Create your first app",
|
|
|
|
link: "/builder/portal/apps",
|
|
|
|
},
|
|
|
|
smtp: {
|
|
|
|
checked: !!smtpConfig,
|
|
|
|
label: "Set up email",
|
|
|
|
link: "/builder/portal/manage/email",
|
|
|
|
},
|
|
|
|
adminUser: {
|
2022-06-30 13:01:15 +02:00
|
|
|
checked: userExists,
|
2022-05-23 17:57:15 +02:00
|
|
|
label: "Create your first user",
|
|
|
|
link: "/builder/portal/manage/users",
|
|
|
|
},
|
|
|
|
sso: {
|
|
|
|
checked: !!googleConfig || !!oidcConfig,
|
|
|
|
label: "Set up single sign-on",
|
|
|
|
link: "/builder/portal/manage/auth",
|
|
|
|
},
|
|
|
|
}
|
2022-05-23 01:09:03 +02:00
|
|
|
}
|
2021-05-05 21:58:31 +02:00
|
|
|
)
|
2022-11-23 19:25:20 +01:00
|
|
|
} catch (err: any) {
|
2021-05-05 21:58:31 +02:00
|
|
|
ctx.throw(err.status, err)
|
|
|
|
}
|
|
|
|
}
|