Skip to content

Commit

Permalink
fix(core): allow no password user to set password in console profile
Browse files Browse the repository at this point in the history
  • Loading branch information
charIeszhao committed Sep 11, 2024
1 parent cc346b4 commit b30f111
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/routes-me/user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { emailRegEx, PasswordPolicyChecker, usernameRegEx } from '@logto/core-kit';
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 RequestError from '#src/errors/RequestError/index.js';
Expand Down Expand Up @@ -141,7 +141,7 @@ export default function userRoutes<T extends AuthedMeRouter>(

const [signInExperience] = await Promise.all([
findDefaultSignInExperience(),
checkVerificationStatus(userId, null),
...condArray(user.passwordEncrypted && [checkVerificationStatus(userId, null)]),

Check warning on line 144 in packages/core/src/routes-me/user.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/routes-me/user.ts#L144

Added line #L144 was not covered by tests
]);
const passwordPolicyChecker = new PasswordPolicyChecker(signInExperience.passwordPolicy);
const issues = await checkPasswordPolicyForUser(passwordPolicyChecker, password, user);
Expand Down

0 comments on commit b30f111

Please sign in to comment.