diff --git a/packages/cli/bin/logto b/packages/cli/bin/logto.js similarity index 100% rename from packages/cli/bin/logto rename to packages/cli/bin/logto.js diff --git a/packages/cli/package.json b/packages/cli/package.json index b77996a3a..6031f19e3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -11,7 +11,7 @@ }, "main": "lib/index.js", "bin": { - "logto": "bin/logto" + "logto": "bin/logto.js" }, "files": [ "bin", diff --git a/packages/core/src/routes/session/profile.test.ts b/packages/core/src/routes/session/profile.test.ts index 0ae2492cb..345e0fcf5 100644 --- a/packages/core/src/routes/session/profile.test.ts +++ b/packages/core/src/routes/session/profile.test.ts @@ -62,8 +62,8 @@ const mockFindSocialRelatedUser = jest.fn(async () => [ { id: 'user1', identities: {}, isSuspended: false }, ]); const mockGetUserInfoByAuthCode = jest.fn(); -jest.mock('#src/lib/social', () => ({ - ...jest.requireActual('@/lib/social'), +jest.mock('#src/lib/social.js', () => ({ + ...jest.requireActual('#src/lib/social.js'), findSocialRelatedUser: async () => mockFindSocialRelatedUser(), getUserInfoByAuthCode: async () => mockGetUserInfoByAuthCode(), })); diff --git a/packages/core/src/routes/session/profile.ts b/packages/core/src/routes/session/profile.ts index 2b37e2d73..70332ba6f 100644 --- a/packages/core/src/routes/session/profile.ts +++ b/packages/core/src/routes/session/profile.ts @@ -9,9 +9,10 @@ import { object, string, unknown } from 'zod'; import { getLogtoConnectorById } from '#src/connectors/index.js'; import RequestError from '#src/errors/RequestError/index.js'; import { checkSessionHealth } from '#src/lib/session.js'; +import { getUserInfoByAuthCode } from '#src/lib/social.js'; import { encryptUserPassword } from '#src/lib/user.js'; import koaGuard from '#src/middleware/koa-guard.js'; -import { findUserById, updateUserById } from '#src/queries/user.js'; +import { deleteUserIdentity, findUserById, updateUserById } from '#src/queries/user.js'; import assertThat from '#src/utils/assert-that.js'; import type { AnonymousRouter } from '../types.js';