diff --git a/packages/core/src/connectors/index.test.ts b/packages/core/src/connectors/index.test.ts index e00a2006c..1346e3725 100644 --- a/packages/core/src/connectors/index.test.ts +++ b/packages/core/src/connectors/index.test.ts @@ -4,7 +4,6 @@ import { Connector } from '@logto/schemas'; import { getConnectorInstanceById, getConnectorInstances, - getEnabledSocialConnectorIds, getSocialConnectorInstanceById, initConnectors, } from '@/connectors/index'; @@ -188,17 +187,6 @@ describe('getSocialConnectorInstanceById', () => { }); }); -describe('getEnabledSocialConnectorIds', () => { - test('should return the enabled social connectors existing in DB', async () => { - const enabledSocialConnectorIds = await getEnabledSocialConnectorIds(); - expect(enabledSocialConnectorIds).toEqual([ - 'alipay-web', - 'facebook-universal', - 'github-universal', - ]); - }); -}); - describe('initConnectors', () => { test('should insert the necessary connector if it does not exist in DB', async () => { findAllConnectors.mockImplementationOnce(async () => []); diff --git a/packages/core/src/connectors/index.ts b/packages/core/src/connectors/index.ts index 11d7cf4ab..9b3cae99a 100644 --- a/packages/core/src/connectors/index.ts +++ b/packages/core/src/connectors/index.ts @@ -140,19 +140,6 @@ export const getSocialConnectorInstanceById = async ( return connector; }; -export const getEnabledSocialConnectorIds = async (): Promise< - string[] -> => { - const connectorInstances = await getConnectorInstances(); - - return connectorInstances - .filter( - (instance): instance is T => - instance.connector.enabled && instance.metadata.type === ConnectorType.Social - ) - .map((instance) => instance.connector.id); -}; - export const initConnectors = async () => { const connectors = await findAllConnectors(); const existingConnectors = new Map(connectors.map((connector) => [connector.id, connector])); diff --git a/packages/core/src/routes/sign-in-experience.test.ts b/packages/core/src/routes/sign-in-experience.test.ts index 8dc9ce200..d1efc0cfc 100644 --- a/packages/core/src/routes/sign-in-experience.test.ts +++ b/packages/core/src/routes/sign-in-experience.test.ts @@ -32,7 +32,6 @@ const getConnectorInstances = jest.fn(async () => connectorInstances); jest.mock('@/connectors', () => { return { ...jest.requireActual('@/connectors'), - getEnabledSocialConnectorIds: jest.fn(async () => ['facebook', 'github', 'wechat']), getConnectorInstances: jest.fn(async () => getConnectorInstances()), }; });