Make password optional
This commit is contained in:
parent
6728fdad1d
commit
ff231b0095
|
@ -500,13 +500,13 @@ export class UserDB {
|
|||
|
||||
static async createAdminUser(
|
||||
email: string,
|
||||
password: string,
|
||||
tenantId: string,
|
||||
password?: string,
|
||||
opts?: CreateAdminUserOpts
|
||||
) {
|
||||
const user: User = {
|
||||
email: email,
|
||||
password: password,
|
||||
password,
|
||||
createdAt: Date.now(),
|
||||
roles: {},
|
||||
builder: {
|
||||
|
|
|
@ -63,7 +63,7 @@ export interface SearchUsersRequest {
|
|||
|
||||
export interface CreateAdminUserRequest {
|
||||
email: string
|
||||
password: string
|
||||
password?: string
|
||||
tenantId: string
|
||||
ssoId?: string
|
||||
}
|
||||
|
|
|
@ -7,12 +7,13 @@ import { users } from "../validation"
|
|||
import * as selfController from "../../controllers/global/self"
|
||||
|
||||
const router: Router = new Router()
|
||||
const OPTIONAL_STRING = Joi.string().optional().allow(null).allow("")
|
||||
|
||||
function buildAdminInitValidation() {
|
||||
return auth.joiValidator.body(
|
||||
Joi.object({
|
||||
email: Joi.string().required(),
|
||||
password: Joi.string(),
|
||||
password: OPTIONAL_STRING,
|
||||
tenantId: Joi.string().required(),
|
||||
ssoId: Joi.string(),
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue