0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

feat(connector,core): remove email service feature switch (#4165)

This commit is contained in:
Darcy Ye 2023-07-24 14:29:38 +08:00 committed by GitHub
parent 3d828f2e6d
commit 3ef8c06d4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 15 deletions

View file

@ -1,5 +1,3 @@
import { getEnv } from '@silverhand/essentials';
import type { ConnectorMetadata } from '@logto/connector-kit';
import { ConnectorConfigFormItemType } from '@logto/connector-kit';
@ -106,9 +104,6 @@ export const scope = ['send:email'];
export const defaultTimeout = 5000;
/** @deprecated Will be replaced by `/services/mails` soon. */
export const demoEmailEndpoint = '/services/send-email';
export const emailEndpoint =
getEnv('NODE_ENV') === 'production' ? demoEmailEndpoint : '/services/mails';
export const emailEndpoint = '/services/mails';
export const usageEndpoint = '/services/mails/usage';

View file

@ -8,7 +8,6 @@ import { connectorDirectory } from '@logto/cli/lib/constants.js';
import { getConnectorPackagesFromDirectory } from '@logto/cli/lib/utils.js';
import {
demoConnectorIds,
serviceConnectorIds,
ConnectorType,
type EmailConnector,
type SmsConnector,
@ -27,13 +26,7 @@ export const isPasswordlessLogtoConnector = (
): connector is LogtoConnector<EmailConnector | SmsConnector> =>
connector.type !== ConnectorType.Social;
/**
* Treat Logto service connectors as demo connectors in production since they are not available
* for public use yet.
*/
const isDemoConnector = (connectorId: string) =>
demoConnectorIds.includes(connectorId) ||
(EnvSet.values.isProduction && serviceConnectorIds.includes(connectorId));
const isDemoConnector = (connectorId: string) => demoConnectorIds.includes(connectorId);
export const transpileLogtoConnector = async (
connector: LogtoConnector,
@ -70,7 +63,6 @@ export const transpileConnectorFactory = ({
return {
type,
...metadata,
/** Temporarily block entering Logto email connector as well until this feature is ready for prod. */
isDemo: isDemoConnector(metadata.id),
};
};