mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
fix(core): allow no password user to set password in console profile (#6572)
This commit is contained in:
parent
380cc43e64
commit
a6178f45e2
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { emailRegEx, PasswordPolicyChecker, usernameRegEx } from '@logto/core-kit';
|
import { emailRegEx, PasswordPolicyChecker, usernameRegEx } from '@logto/core-kit';
|
||||||
import { userInfoSelectFields, jsonObjectGuard } from '@logto/schemas';
|
import { userInfoSelectFields, jsonObjectGuard } from '@logto/schemas';
|
||||||
import { conditional, pick } from '@silverhand/essentials';
|
import { condArray, conditional, pick } from '@silverhand/essentials';
|
||||||
import { literal, object, string } from 'zod';
|
import { literal, object, string } from 'zod';
|
||||||
|
|
||||||
import RequestError from '#src/errors/RequestError/index.js';
|
import RequestError from '#src/errors/RequestError/index.js';
|
||||||
|
@ -141,7 +141,7 @@ export default function userRoutes<T extends AuthedMeRouter>(
|
||||||
|
|
||||||
const [signInExperience] = await Promise.all([
|
const [signInExperience] = await Promise.all([
|
||||||
findDefaultSignInExperience(),
|
findDefaultSignInExperience(),
|
||||||
checkVerificationStatus(userId, null),
|
...condArray(user.passwordEncrypted && [checkVerificationStatus(userId, null)]),
|
||||||
]);
|
]);
|
||||||
const passwordPolicyChecker = new PasswordPolicyChecker(signInExperience.passwordPolicy);
|
const passwordPolicyChecker = new PasswordPolicyChecker(signInExperience.passwordPolicy);
|
||||||
const issues = await checkPasswordPolicyForUser(passwordPolicyChecker, password, user);
|
const issues = await checkPasswordPolicyForUser(passwordPolicyChecker, password, user);
|
||||||
|
|
Loading…
Reference in a new issue