PR comments.

This commit is contained in:
mike12345567 2024-01-05 13:58:31 +00:00
parent f2f16cfcee
commit b4b8e16f22
3 changed files with 5 additions and 5 deletions

View File

@ -48,7 +48,7 @@ type CreateAdminUserOpts = {
ssoId?: string
hashPassword?: boolean
requirePassword?: boolean
noPasswordValidation?: boolean
skipPasswordValidation?: boolean
}
type FeatureFns = { isSSOEnforced: FeatureFn; isAppBuildersEnabled: FeatureFn }
@ -118,7 +118,7 @@ export class UserDB {
throw new HTTPError("Password change is disabled for this user", 400)
}
if (!opts.noPasswordValidation) {
if (!opts.skipPasswordValidation) {
const passwordValidation = validatePassword(password)
if (!passwordValidation.valid) {
throw new HTTPError(passwordValidation.error, 400)
@ -521,7 +521,7 @@ export class UserDB {
return await UserDB.save(user, {
hashPassword: opts?.hashPassword,
requirePassword: opts?.requirePassword,
noPasswordValidation: opts?.noPasswordValidation,
skipPasswordValidation: opts?.skipPasswordValidation,
})
}

View File

@ -141,7 +141,7 @@ export async function startup(app?: Koa, server?: Server) {
{
hashPassword: true,
requirePassword: true,
noPasswordValidation: true,
skipPasswordValidation: true,
}
)
// Need to set up an API key for automated integration tests

View File

@ -2,5 +2,5 @@ export interface SaveUserOpts {
hashPassword?: boolean
requirePassword?: boolean
currentUserId?: string
noPasswordValidation?: boolean
skipPasswordValidation?: boolean
}