Validate password on admin creation
This commit is contained in:
parent
3b50d1a988
commit
e50cc35140
|
@ -38,7 +38,7 @@
|
|||
$goto("../portal")
|
||||
} catch (error) {
|
||||
submitted = false
|
||||
notifications.error("Failed to create admin user")
|
||||
notifications.error(error.message || "Failed to create admin user")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -27,6 +27,7 @@ import {
|
|||
platform,
|
||||
tenancy,
|
||||
db,
|
||||
security,
|
||||
} from "@budibase/backend-core"
|
||||
import { checkAnyUserExists } from "../../../utilities/users"
|
||||
import { isEmailConfigured } from "../../../utilities/email"
|
||||
|
@ -98,6 +99,11 @@ export const adminUser = async (
|
|||
ctx.throw(403, "Organisation already exists.")
|
||||
}
|
||||
|
||||
const passwordValidation = security.validatePassword(password)
|
||||
if (!passwordValidation.valid) {
|
||||
ctx.throw(400, passwordValidation.error)
|
||||
}
|
||||
|
||||
if (env.MULTI_TENANCY) {
|
||||
// store the new tenant record in the platform db
|
||||
await platform.tenants.addTenant(tenantId)
|
||||
|
|
Loading…
Reference in New Issue