mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
fix(console): passwordless connectors should not show callbackUri (#3310)
This commit is contained in:
parent
1ca42e0573
commit
6fd51effdc
3 changed files with 25 additions and 10 deletions
|
@ -115,7 +115,11 @@ const ConnectorContent = ({ isDeleted, connectorData, onConnectorUpdated }: Prop
|
|||
!isSocialConnector && getDocumentationUrl('/docs/references/connectors')
|
||||
)}
|
||||
>
|
||||
<ConfigForm formItems={connectorData.formItems} connectorId={connectorData.id} />
|
||||
<ConfigForm
|
||||
formItems={connectorData.formItems}
|
||||
connectorId={connectorData.id}
|
||||
connectorType={connectorData.type}
|
||||
/>
|
||||
</FormCard>
|
||||
{/* Tell typescript that the connectorType is Email or Sms */}
|
||||
{connectorData.type !== ConnectorType.Social && (
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import type { ConnectorConfigFormItem } from '@logto/connector-kit';
|
||||
import { ConnectorType } from '@logto/connector-kit';
|
||||
import type { ConnectorFactoryResponse } from '@logto/schemas';
|
||||
import { useContext } from 'react';
|
||||
import { Controller, useFormContext } from 'react-hook-form';
|
||||
|
@ -19,9 +20,16 @@ type Props = {
|
|||
formItems?: ConnectorConfigFormItem[];
|
||||
className?: string;
|
||||
connectorId: string;
|
||||
connectorType: ConnectorType;
|
||||
};
|
||||
|
||||
const ConfigForm = ({ configTemplate, formItems, className, connectorId }: Props) => {
|
||||
const ConfigForm = ({
|
||||
configTemplate,
|
||||
formItems,
|
||||
className,
|
||||
connectorId,
|
||||
connectorType,
|
||||
}: Props) => {
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
const {
|
||||
control,
|
||||
|
@ -31,14 +39,16 @@ const ConfigForm = ({ configTemplate, formItems, className, connectorId }: Props
|
|||
|
||||
return (
|
||||
<div className={className}>
|
||||
<FormField title="connectors.guide.callback_uri">
|
||||
<CopyToClipboard
|
||||
className={styles.copyToClipboard}
|
||||
variant="border"
|
||||
value={new URL(`/callback/${connectorId}`, userEndpoint).toString()}
|
||||
/>
|
||||
<div className={styles.description}>{t('connectors.guide.callback_uri_description')}</div>
|
||||
</FormField>
|
||||
{connectorType === ConnectorType.Social && (
|
||||
<FormField title="connectors.guide.callback_uri">
|
||||
<CopyToClipboard
|
||||
className={styles.copyToClipboard}
|
||||
variant="border"
|
||||
value={new URL(`/callback/${connectorId}`, userEndpoint).toString()}
|
||||
/>
|
||||
<div className={styles.description}>{t('connectors.guide.callback_uri_description')}</div>
|
||||
</FormField>
|
||||
)}
|
||||
{formItems ? (
|
||||
<ConfigFormItems formItems={formItems} />
|
||||
) : (
|
||||
|
|
|
@ -190,6 +190,7 @@ const Guide = ({ connector, onClose }: Props) => {
|
|||
<ConfigForm
|
||||
connectorId={callbackConnectorId}
|
||||
configTemplate={connector.configTemplate}
|
||||
connectorType={connectorType}
|
||||
formItems={connector.formItems}
|
||||
/>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue