PR comments.
This commit is contained in:
parent
f2f16cfcee
commit
b4b8e16f22
|
@ -48,7 +48,7 @@ type CreateAdminUserOpts = {
|
||||||
ssoId?: string
|
ssoId?: string
|
||||||
hashPassword?: boolean
|
hashPassword?: boolean
|
||||||
requirePassword?: boolean
|
requirePassword?: boolean
|
||||||
noPasswordValidation?: boolean
|
skipPasswordValidation?: boolean
|
||||||
}
|
}
|
||||||
type FeatureFns = { isSSOEnforced: FeatureFn; isAppBuildersEnabled: FeatureFn }
|
type FeatureFns = { isSSOEnforced: FeatureFn; isAppBuildersEnabled: FeatureFn }
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ export class UserDB {
|
||||||
throw new HTTPError("Password change is disabled for this user", 400)
|
throw new HTTPError("Password change is disabled for this user", 400)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!opts.noPasswordValidation) {
|
if (!opts.skipPasswordValidation) {
|
||||||
const passwordValidation = validatePassword(password)
|
const passwordValidation = validatePassword(password)
|
||||||
if (!passwordValidation.valid) {
|
if (!passwordValidation.valid) {
|
||||||
throw new HTTPError(passwordValidation.error, 400)
|
throw new HTTPError(passwordValidation.error, 400)
|
||||||
|
@ -521,7 +521,7 @@ export class UserDB {
|
||||||
return await UserDB.save(user, {
|
return await UserDB.save(user, {
|
||||||
hashPassword: opts?.hashPassword,
|
hashPassword: opts?.hashPassword,
|
||||||
requirePassword: opts?.requirePassword,
|
requirePassword: opts?.requirePassword,
|
||||||
noPasswordValidation: opts?.noPasswordValidation,
|
skipPasswordValidation: opts?.skipPasswordValidation,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ export async function startup(app?: Koa, server?: Server) {
|
||||||
{
|
{
|
||||||
hashPassword: true,
|
hashPassword: true,
|
||||||
requirePassword: true,
|
requirePassword: true,
|
||||||
noPasswordValidation: true,
|
skipPasswordValidation: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
// Need to set up an API key for automated integration tests
|
// Need to set up an API key for automated integration tests
|
||||||
|
|
|
@ -2,5 +2,5 @@ export interface SaveUserOpts {
|
||||||
hashPassword?: boolean
|
hashPassword?: boolean
|
||||||
requirePassword?: boolean
|
requirePassword?: boolean
|
||||||
currentUserId?: string
|
currentUserId?: string
|
||||||
noPasswordValidation?: boolean
|
skipPasswordValidation?: boolean
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue